Skip to content

Commit b5765a1

Browse files
YongWu-HFjoergroedel
authored andcommitted
iommu/mediatek: Use component_match_add
In order to simplify the error patch(avoid call of_node_put), Use component_match_add instead component_match_add_release since we are only interested in the "device" here. Then we could always call of_node_put in normal path. Strictly this is not a fixes patch, but it is a prepare for adding the error path, thus I add a Fixes tag too. Fixes: d2e9a11 ("iommu/mediatek: Contain MM IOMMU flow with the MM TYPE") Suggested-by: Robin Murphy <[email protected]> Signed-off-by: Yong Wu <[email protected]> Reviewed-by: AngeloGioacchino Del Regno <[email protected]> Reviewed-by: Matthias Brugger <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Joerg Roedel <[email protected]>
1 parent dcb40e9 commit b5765a1

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

drivers/iommu/mtk_iommu.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1080,19 +1080,17 @@ static int mtk_iommu_mm_dts_parse(struct device *dev, struct component_match **m
10801080
id = i;
10811081

10821082
plarbdev = of_find_device_by_node(larbnode);
1083-
if (!plarbdev) {
1084-
of_node_put(larbnode);
1083+
of_node_put(larbnode);
1084+
if (!plarbdev)
10851085
return -ENODEV;
1086-
}
1086+
10871087
if (!plarbdev->dev.driver) {
1088-
of_node_put(larbnode);
10891088
platform_device_put(plarbdev);
10901089
return -EPROBE_DEFER;
10911090
}
10921091
data->larb_imu[id].dev = &plarbdev->dev;
10931092

1094-
component_match_add_release(dev, match, component_release_of,
1095-
component_compare_of, larbnode);
1093+
component_match_add(dev, match, component_compare_dev, &plarbdev->dev);
10961094
platform_device_put(plarbdev);
10971095
}
10981096

0 commit comments

Comments
 (0)