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 <[email protected]> Cc: Will Deacon <[email protected]> Cc: Matthias Brugger <[email protected]> Cc: Yunfei Wang <[email protected]> Cc: Libo Kang <[email protected]> Cc: Anan Sun <[email protected]> Cc: Mingyuan Ma <[email protected]> Cc: Xueqi Zhang <[email protected]> Signed-off-by: Yong Wu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent ab011ab commit 4811a48

File tree

3 files changed

+4
-14
lines changed

3 files changed

+4
-14
lines changed

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)