Commit e7acc36f authored by Robin Murphy's avatar Robin Murphy Committed by Will Deacon

iommu/mediatek-v1: Clean up redundant fwspec checks

The driver explicitly clears any existing fwspec before calling
mtk_iommu_v1_create_mapping(), but even if it didn't, the checks it's
doing there duplicate what iommu_fwspec_init() would do anyway. Clean
them up.
Reported-by: default avatarkernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202407020415.KKnhPTUj-lkp@intel.com/Signed-off-by: default avatarRobin Murphy <robin.murphy@arm.com>
Link: https://lore.kernel.org/r/7d6ebec135483f889af00eb376aa31c012efc3b2.1719919669.git.robin.murphy@arm.comSigned-off-by: default avatarWill Deacon <will@kernel.org>
parent 83a7eefe
...@@ -401,7 +401,6 @@ static const struct iommu_ops mtk_iommu_v1_ops; ...@@ -401,7 +401,6 @@ static const struct iommu_ops mtk_iommu_v1_ops;
static int mtk_iommu_v1_create_mapping(struct device *dev, static int mtk_iommu_v1_create_mapping(struct device *dev,
const struct of_phandle_args *args) const struct of_phandle_args *args)
{ {
struct iommu_fwspec *fwspec = dev_iommu_fwspec_get(dev);
struct mtk_iommu_v1_data *data; struct mtk_iommu_v1_data *data;
struct platform_device *m4updev; struct platform_device *m4updev;
struct dma_iommu_mapping *mtk_mapping; struct dma_iommu_mapping *mtk_mapping;
...@@ -413,14 +412,9 @@ static int mtk_iommu_v1_create_mapping(struct device *dev, ...@@ -413,14 +412,9 @@ static int mtk_iommu_v1_create_mapping(struct device *dev,
return -EINVAL; return -EINVAL;
} }
if (!fwspec) { ret = iommu_fwspec_init(dev, &args->np->fwnode, &mtk_iommu_v1_ops);
ret = iommu_fwspec_init(dev, &args->np->fwnode, &mtk_iommu_v1_ops); if (ret)
if (ret) return ret;
return ret;
fwspec = dev_iommu_fwspec_get(dev);
} else if (dev_iommu_fwspec_get(dev)->ops != &mtk_iommu_v1_ops) {
return -EINVAL;
}
if (!dev_iommu_priv_get(dev)) { if (!dev_iommu_priv_get(dev)) {
/* Get the m4u device */ /* Get the m4u device */
......
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