[PATCH v2 0/3] drm: Add component_match_add_of and convert users of drm_of_component_match_add
This series adds a new function component_match_add_of to simplify the common case of calling component_match_add_release with component_release_of and component_compare_of. There is already drm_of_component_match_add, which allows for a custom compare function. However, all existing users just use component_compare_of (or an equivalent).
Changes in v2: - Split off conversion from helper addition - Rebased onto drm/drm-next
Sean Anderson (3): component: Add helper for device nodes iommu/sound: Use component_match_add_of helper drm: Convert users of drm_of_component_match_add to component_match_add_of
.../gpu/drm/arm/display/komeda/komeda_drv.c | 6 ++-- drivers/gpu/drm/arm/hdlcd_drv.c | 9 +----- drivers/gpu/drm/arm/malidp_drv.c | 11 +------ drivers/gpu/drm/armada/armada_drv.c | 10 ++++--- drivers/gpu/drm/drm_of.c | 29 +++---------------- drivers/gpu/drm/etnaviv/etnaviv_drv.c | 4 +-- .../gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 3 +- drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 3 +- drivers/gpu/drm/mediatek/mtk_drm_drv.c | 4 +-- drivers/gpu/drm/msm/msm_drv.c | 14 ++++----- drivers/gpu/drm/sti/sti_drv.c | 3 +- drivers/gpu/drm/sun4i/sun4i_drv.c | 3 +- drivers/gpu/drm/tilcdc/tilcdc_external.c | 10 ++----- drivers/iommu/mtk_iommu.c | 3 +- drivers/iommu/mtk_iommu_v1.c | 3 +- include/drm/drm_of.h | 12 -------- include/linux/component.h | 9 ++++++ sound/soc/codecs/wcd938x.c | 6 ++-- 18 files changed, 46 insertions(+), 96 deletions(-)
Convert users of component_match_add_release with component_release_of and component_compare_of to component_match_add_of.
Signed-off-by: Sean Anderson sean.anderson@seco.com Acked-by: Mark Brown broonie@kernel.org ---
Changes in v2: - Split off from helper addition
drivers/iommu/mtk_iommu.c | 3 +-- drivers/iommu/mtk_iommu_v1.c | 3 +-- sound/soc/codecs/wcd938x.c | 6 ++---- 3 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c index 2ab2ecfe01f8..483b7a9e4410 100644 --- a/drivers/iommu/mtk_iommu.c +++ b/drivers/iommu/mtk_iommu.c @@ -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. */ diff --git a/drivers/iommu/mtk_iommu_v1.c b/drivers/iommu/mtk_iommu_v1.c index 6e0e65831eb7..fb09ed6bf550 100644 --- a/drivers/iommu/mtk_iommu_v1.c +++ b/drivers/iommu/mtk_iommu_v1.c @@ -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); diff --git a/sound/soc/codecs/wcd938x.c b/sound/soc/codecs/wcd938x.c index aca06a4026f3..2f8444e54083 100644 --- a/sound/soc/codecs/wcd938x.c +++ b/sound/soc/codecs/wcd938x.c @@ -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; }
Hi Sean,
On 22/12/2022 11:37 pm, Sean Anderson wrote:
Convert users of component_match_add_release with component_release_of and component_compare_of to component_match_add_of.
Signed-off-by: Sean Anderson sean.anderson@seco.com Acked-by: Mark Brown broonie@kernel.org
Changes in v2:
Split off from helper addition
drivers/iommu/mtk_iommu.c | 3 +-- drivers/iommu/mtk_iommu_v1.c | 3 +-- sound/soc/codecs/wcd938x.c | 6 ++---- 3 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c index 2ab2ecfe01f8..483b7a9e4410 100644 --- a/drivers/iommu/mtk_iommu.c +++ b/drivers/iommu/mtk_iommu.c @@ -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);
I've long since given up trying to make sense of how the DRM tree works, but the conflicting change is definitely already in mainline:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit?id...
Thanks, Robin.
}
/* Get smi-(sub)-common dev from the last larb. */ diff --git a/drivers/iommu/mtk_iommu_v1.c b/drivers/iommu/mtk_iommu_v1.c index 6e0e65831eb7..fb09ed6bf550 100644 --- a/drivers/iommu/mtk_iommu_v1.c +++ b/drivers/iommu/mtk_iommu_v1.c @@ -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);
diff --git a/sound/soc/codecs/wcd938x.c b/sound/soc/codecs/wcd938x.c index aca06a4026f3..2f8444e54083 100644 --- a/sound/soc/codecs/wcd938x.c +++ b/sound/soc/codecs/wcd938x.c @@ -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; }
Hi Robin,
On Tue, Jan 03, 2023 at 01:01:07PM +0000, Robin Murphy wrote:
Hi Sean,
On 22/12/2022 11:37 pm, Sean Anderson wrote:
Convert users of component_match_add_release with component_release_of and component_compare_of to component_match_add_of.
Signed-off-by: Sean Anderson sean.anderson@seco.com Acked-by: Mark Brown broonie@kernel.org
Changes in v2:
Split off from helper addition
drivers/iommu/mtk_iommu.c | 3 +-- drivers/iommu/mtk_iommu_v1.c | 3 +-- sound/soc/codecs/wcd938x.c | 6 ++---- 3 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c index 2ab2ecfe01f8..483b7a9e4410 100644 --- a/drivers/iommu/mtk_iommu.c +++ b/drivers/iommu/mtk_iommu.c @@ -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);
I've long since given up trying to make sense of how the DRM tree works, but the conflicting change is definitely already in mainline:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit?id...
As far as I can see, that patch doesn't affect DRM at all, and the commit you pointed to doesn't either, nor has it been merged through the DRM tree.
Can you expand a bit on how we're involved in this, what we should clarify or help with?
Maxime
On 1/3/23 11:15, Maxime Ripard wrote:
Hi Robin,
On Tue, Jan 03, 2023 at 01:01:07PM +0000, Robin Murphy wrote:
Hi Sean,
On 22/12/2022 11:37 pm, Sean Anderson wrote:
Convert users of component_match_add_release with component_release_of and component_compare_of to component_match_add_of.
Signed-off-by: Sean Anderson sean.anderson@seco.com Acked-by: Mark Brown broonie@kernel.org
Changes in v2:
Split off from helper addition
drivers/iommu/mtk_iommu.c | 3 +-- drivers/iommu/mtk_iommu_v1.c | 3 +-- sound/soc/codecs/wcd938x.c | 6 ++---- 3 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c index 2ab2ecfe01f8..483b7a9e4410 100644 --- a/drivers/iommu/mtk_iommu.c +++ b/drivers/iommu/mtk_iommu.c @@ -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);
I've long since given up trying to make sense of how the DRM tree works, but the conflicting change is definitely already in mainline:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit?id...
As far as I can see, that patch doesn't affect DRM at all, and the commit you pointed to doesn't either, nor has it been merged through the DRM tree.
Can you expand a bit on how we're involved in this, what we should clarify or help with?
Patches 2 and 3 of this series depend on patch 1. Since patch 3 contains the bulk of the changes, I based this series on the drm-next tree. However, patch 2 has a conflict elswhere in the tree, which did not appear until 6.2-rc1. At the time I sent out this series, drm-next did not contain this commit, and I couldn't find it based on Robin's description [1], so now we end up with a conflict. As this commit has now been merged into drm-next, I can rebase and resend if there are no other comments.
--Sean
[1] https://lore.kernel.org/linux-arm-kernel/56310773-a062-0e48-28f7-6d2c5d035fe...
On 03/01/2023 4:15 pm, Maxime Ripard wrote:
Hi Robin,
On Tue, Jan 03, 2023 at 01:01:07PM +0000, Robin Murphy wrote:
Hi Sean,
On 22/12/2022 11:37 pm, Sean Anderson wrote:
Convert users of component_match_add_release with component_release_of and component_compare_of to component_match_add_of.
Signed-off-by: Sean Anderson sean.anderson@seco.com Acked-by: Mark Brown broonie@kernel.org
Changes in v2:
Split off from helper addition
drivers/iommu/mtk_iommu.c | 3 +-- drivers/iommu/mtk_iommu_v1.c | 3 +-- sound/soc/codecs/wcd938x.c | 6 ++---- 3 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c index 2ab2ecfe01f8..483b7a9e4410 100644 --- a/drivers/iommu/mtk_iommu.c +++ b/drivers/iommu/mtk_iommu.c @@ -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);
I've long since given up trying to make sense of how the DRM tree works, but the conflicting change is definitely already in mainline:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit?id...
As far as I can see, that patch doesn't affect DRM at all, and the commit you pointed to doesn't either, nor has it been merged through the DRM tree.
Right it doesn't affect DRM, and was merged via the IOMMU tree, but it does affect *this* patch, which Sean has based on a drm-next branch that seemingly still wasn't up to date with 6.2-rc1 at the time.
Since v2 had already been posted, it seemed like a bright idea to comment here to clarify that it was still relevant, rather than bumping the old thread to reply directly. Apologies for any confusion.
In practical terms I think it's merely a case of dropping this hunk; the other one in mtk_iommu_v1.c looks fine to me.
Cheers, Robin.
Can you expand a bit on how we're involved in this, what we should clarify or help with?
Maxime
participants (3)
-
Maxime Ripard
-
Robin Murphy
-
Sean Anderson