@@ -1079,8 +1079,7 @@ static int mtk_iommu_mm_dts_parse(struct device *dev, struct component_match **m
}
data->larb_imu[id].dev = &plarbdev->dev;
- component_match_add_release(dev, match, component_release_of,
- component_compare_of, larbnode);
+ component_match_add_of(dev, match, larbnode);
}
/* Get smi-(sub)-common dev from the last larb. */
@@ -672,8 +672,7 @@ static int mtk_iommu_v1_probe(struct platform_device *pdev)
}
data->larb_imu[i].dev = &plarbdev->dev;
- component_match_add_release(dev, &match, component_release_of,
- component_compare_of, larbnode);
+ component_match_add_of(dev, &match, larbnode);
}
platform_set_drvdata(pdev, data);
@@ -6,6 +6,7 @@
struct device;
+struct device_node;
/**
* struct component_ops - callbacks for component drivers
@@ -128,4 +129,12 @@ static inline void component_match_add(struct device *parent,
compare_data);
}
+static inline void component_match_add_of(struct device *parent,
+ struct component_match **matchptr,
+ struct device_node *node)
+{
+ component_match_add_release(parent, matchptr, component_release_of,
+ component_compare_of, node);
+}
+
#endif
@@ -4474,8 +4474,7 @@ static int wcd938x_add_slave_components(struct wcd938x_priv *wcd938x,
}
of_node_get(wcd938x->rxnode);
- component_match_add_release(dev, matchptr, component_release_of,
- component_compare_of, wcd938x->rxnode);
+ component_match_add_of(dev, matchptr, wcd938x->rxnode);
wcd938x->txnode = of_parse_phandle(np, "qcom,tx-device", 0);
if (!wcd938x->txnode) {
@@ -4483,8 +4482,7 @@ static int wcd938x_add_slave_components(struct wcd938x_priv *wcd938x,
return -ENODEV;
}
of_node_get(wcd938x->txnode);
- component_match_add_release(dev, matchptr, component_release_of,
- component_compare_of, wcd938x->txnode);
+ component_match_add_of(dev, matchptr, wcd938x->txnode);
return 0;
}
There is a common case where component_patch_add_release is called with component_release_of/component_compare_of and a device node. Add a helper and convert existing users. Signed-off-by: Sean Anderson <sean.anderson@seco.com> --- drivers/iommu/mtk_iommu.c | 3 +-- drivers/iommu/mtk_iommu_v1.c | 3 +-- include/linux/component.h | 9 +++++++++ sound/soc/codecs/wcd938x.c | 6 ++---- 4 files changed, 13 insertions(+), 8 deletions(-)