Skip to content

Commit

Permalink
iommu/exynos: Add/remove callbacks should fail if no iommu is available
Browse files Browse the repository at this point in the history
Return fail if given master device passed to add_device/remove_device
callbacks doesn't has associated any sysmmu controller.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Tested-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
  • Loading branch information
mszyprow authored and joergroedel committed May 29, 2015
1 parent 2860af3 commit 06801db
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/iommu/exynos-iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1082,6 +1082,9 @@ static int exynos_iommu_add_device(struct device *dev)
struct iommu_group *group;
int ret;

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

group = iommu_group_get(dev);

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

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

iommu_group_remove_device(dev);
}

Expand Down

0 comments on commit 06801db

Please sign in to comment.