Commit 23357572 authored by Yong Wu's avatar Yong Wu Committed by Will Deacon

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: default avatarYong Wu <yong.wu@mediatek.com>
Reviewed-by: default avatarTomasz Figa <tfiga@chromium.org>
Link: https://lore.kernel.org/r/20210111111914.22211-32-yong.wu@mediatek.comSigned-off-by: default avatarWill Deacon <will@kernel.org>
parent 8d2c749e
......@@ -453,9 +453,6 @@ static int mtk_iommu_attach_device(struct iommu_domain *domain,
struct device *m4udev = data->dev;
int ret, domid;
if (!data)
return -ENODEV;
domid = mtk_iommu_get_domain_id(dev, data->plat_data);
if (domid < 0)
return domid;
......@@ -492,9 +489,6 @@ static void mtk_iommu_detach_device(struct iommu_domain *domain,
{
struct mtk_iommu_data *data = dev_iommu_priv_get(dev);
if (!data)
return;
mtk_iommu_config(data, dev, false, 0);
}
......
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