Skip to content

Commit 2335757

Browse files
YongWu-HFwilldeacon
authored andcommitted
iommu/mediatek: Remove unnecessary check in attach_device
This priv_data is set in the of_xlate. if of_xlate failed, it should not enter attach_device. remove the unnecessary check. Signed-off-by: Yong Wu <yong.wu@mediatek.com> Reviewed-by: Tomasz Figa <tfiga@chromium.org> Link: https://lore.kernel.org/r/20210111111914.22211-32-yong.wu@mediatek.com Signed-off-by: Will Deacon <will@kernel.org>
1 parent 8d2c749 commit 2335757

1 file changed

Lines changed: 0 additions & 6 deletions

File tree

drivers/iommu/mtk_iommu.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -453,9 +453,6 @@ static int mtk_iommu_attach_device(struct iommu_domain *domain,
453453
struct device *m4udev = data->dev;
454454
int ret, domid;
455455

456-
if (!data)
457-
return -ENODEV;
458-
459456
domid = mtk_iommu_get_domain_id(dev, data->plat_data);
460457
if (domid < 0)
461458
return domid;
@@ -492,9 +489,6 @@ static void mtk_iommu_detach_device(struct iommu_domain *domain,
492489
{
493490
struct mtk_iommu_data *data = dev_iommu_priv_get(dev);
494491

495-
if (!data)
496-
return;
497-
498492
mtk_iommu_config(data, dev, false, 0);
499493
}
500494

0 commit comments

Comments
 (0)