Skip to content

Commit

Permalink
iommu/omap: Add check for iommu group when no IOMMU in use
Browse files Browse the repository at this point in the history
Most of the devices in OMAP family of SoCs are not using IOMMU. The
patch for converting the OMAP IOMMU to use generic IOMMU bus probe
functionality failed to add a check for this, so add it here.

Fixes: c822b37 ("iommu/omap: Remove orphan_dev tracking")
Reported-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Tero Kristo <t-kristo@ti.com>
Link: https://lore.kernel.org/r/20200518111057.23140-1-t-kristo@ti.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
  • Loading branch information
Tero Kristo via iommu authored and Joerg Roedel committed May 18, 2020
1 parent ec9b40c commit 46b14fc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/iommu/omap-iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1726,6 +1726,9 @@ static struct iommu_group *omap_iommu_device_group(struct device *dev)
struct omap_iommu_arch_data *arch_data = dev->archdata.iommu;
struct iommu_group *group = ERR_PTR(-EINVAL);

if (!arch_data)
return ERR_PTR(-ENODEV);

if (arch_data->iommu_dev)
group = iommu_group_ref_get(arch_data->iommu_dev->group);

Expand Down

0 comments on commit 46b14fc

Please sign in to comment.