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

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
......@@ -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) {
......@@ -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);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment