Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 06801db0 authored by Marek Szyprowski's avatar Marek Szyprowski Committed by Joerg Roedel
Browse files

iommu/exynos: Add/remove callbacks should fail if no iommu is available



Return fail if given master device passed to add_device/remove_device
callbacks doesn't has associated any sysmmu controller.

Signed-off-by: default avatarMarek Szyprowski <m.szyprowski@samsung.com>
Tested-by: default avatarJavier Martinez Canillas <javier.martinez@collabora.co.uk>
Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
parent 2860af3c
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -1082,6 +1082,9 @@ static int exynos_iommu_add_device(struct device *dev)
	struct iommu_group *group;
	struct iommu_group *group;
	int ret;
	int ret;


	if (!has_sysmmu(dev))
		return -ENODEV;

	group = iommu_group_get(dev);
	group = iommu_group_get(dev);


	if (!group) {
	if (!group) {
@@ -1100,6 +1103,9 @@ static int exynos_iommu_add_device(struct device *dev)


static void exynos_iommu_remove_device(struct device *dev)
static void exynos_iommu_remove_device(struct device *dev)
{
{
	if (!has_sysmmu(dev))
		return;

	iommu_group_remove_device(dev);
	iommu_group_remove_device(dev);
}
}