Skip to content

Commit 4811a48

Browse files
YongWu-HFgregkh
authored andcommitted
iommu/mediatek: Make use of the helper component_compare/release_of
Use the common compare/release helpers from component. Cc: Joerg Roedel <joro@8bytes.org> Cc: Will Deacon <will@kernel.org> Cc: Matthias Brugger <matthias.bgg@gmail.com> Cc: Yunfei Wang <yf.wang@mediatek.com> Cc: Libo Kang <libo.kang@mediatek.com> Cc: Anan Sun <anan.sun@mediatek.com> Cc: Mingyuan Ma <mingyuan.ma@mediatek.com> Cc: Xueqi Zhang <xueqi.zhang@mediatek.com> Signed-off-by: Yong Wu <yong.wu@mediatek.com> Link: https://lore.kernel.org/r/20220214060819.7334-20-yong.wu@mediatek.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent ab011ab commit 4811a48

3 files changed

Lines changed: 4 additions & 14 deletions

File tree

drivers/iommu/mtk_iommu.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -852,8 +852,8 @@ static int mtk_iommu_probe(struct platform_device *pdev)
852852
}
853853
data->larb_imu[id].dev = &plarbdev->dev;
854854

855-
component_match_add_release(dev, &match, release_of,
856-
compare_of, larbnode);
855+
component_match_add_release(dev, &match, component_release_of,
856+
component_compare_of, larbnode);
857857
}
858858

859859
/* Get smi-common dev from the last larb. */

drivers/iommu/mtk_iommu.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -84,16 +84,6 @@ struct mtk_iommu_data {
8484
struct mtk_smi_larb_iommu larb_imu[MTK_LARB_NR_MAX];
8585
};
8686

87-
static inline int compare_of(struct device *dev, void *data)
88-
{
89-
return dev->of_node == data;
90-
}
91-
92-
static inline void release_of(struct device *dev, void *data)
93-
{
94-
of_node_put(data);
95-
}
96-
9787
static inline int mtk_iommu_bind(struct device *dev)
9888
{
9989
struct mtk_iommu_data *data = dev_get_drvdata(dev);

drivers/iommu/mtk_iommu_v1.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -599,8 +599,8 @@ static int mtk_iommu_probe(struct platform_device *pdev)
599599
}
600600
data->larb_imu[i].dev = &plarbdev->dev;
601601

602-
component_match_add_release(dev, &match, release_of,
603-
compare_of, larbnode);
602+
component_match_add_release(dev, &match, component_release_of,
603+
component_compare_of, larbnode);
604604
}
605605

606606
platform_set_drvdata(pdev, data);

0 commit comments

Comments
 (0)