* [PATCH 1/4] drm: adp: Replace custom compare_dev with component_compare_of
2025-03-31 9:25 [PATCH 0/4] Replace custom compare_dev with component_compare_of in drm shao.mingyin
@ 2025-03-31 9:28 ` shao.mingyin
2025-03-31 11:34 ` Janne Grunau
2025-03-31 9:30 ` [PATCH 2/4] drm: arm: hdlcd: " shao.mingyin
` (2 subsequent siblings)
3 siblings, 1 reply; 8+ messages in thread
From: shao.mingyin @ 2025-03-31 9:28 UTC (permalink / raw)
To: j, liviu.dudau, chunkuang.hu
Cc: fnkl.kernel, maarten.lankhorst, mripard, airlied, simona,
dri-devel, asahi, linux-kernel, p.zabel, matthias.bgg,
angelogioacchino.delregno, linux-mediatek, linux-arm-kernel,
yang.yang29, xu.xin16, ye.xingchen, tang.dongxing, tzimmermann
From: Tang Dongxing <tang.dongxing@zte.com.cn>
Remove the custom device comparison function compare_dev and replace it
with the existing kernel helper component_compare_of
Signed-off-by: Tang Dongxing <tang.dongxing@zte.com.cn>
Signed-off-by: Shao Mingyin <shao.mingyin@zte.com.cn>
---
drivers/gpu/drm/adp/adp_drv.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/adp/adp_drv.c b/drivers/gpu/drm/adp/adp_drv.c
index c98c647f981d..32350c1a5c1f 100644
--- a/drivers/gpu/drm/adp/adp_drv.c
+++ b/drivers/gpu/drm/adp/adp_drv.c
@@ -551,11 +551,6 @@ static const struct component_master_ops adp_master_ops = {
.unbind = adp_drm_unbind,
};
-static int compare_dev(struct device *dev, void *data)
-{
- return dev->of_node == data;
-}
-
static int adp_probe(struct platform_device *pdev)
{
struct device_node *port;
@@ -579,7 +574,7 @@ static int adp_probe(struct platform_device *pdev)
if (!port)
return -ENODEV;
- drm_of_component_match_add(&pdev->dev, &match, compare_dev, port);
+ drm_of_component_match_add(&pdev->dev, &match, component_compare_of, port);
of_node_put(port);
return component_master_add_with_match(&pdev->dev, &adp_master_ops, match);
--
2.25.1
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH 1/4] drm: adp: Replace custom compare_dev with component_compare_of
2025-03-31 9:28 ` [PATCH 1/4] drm: adp: Replace custom compare_dev with component_compare_of shao.mingyin
@ 2025-03-31 11:34 ` Janne Grunau
0 siblings, 0 replies; 8+ messages in thread
From: Janne Grunau @ 2025-03-31 11:34 UTC (permalink / raw)
To: shao.mingyin
Cc: liviu.dudau, chunkuang.hu, fnkl.kernel, maarten.lankhorst,
mripard, airlied, simona, dri-devel, asahi, linux-kernel,
p.zabel, matthias.bgg, angelogioacchino.delregno, linux-mediatek,
linux-arm-kernel, yang.yang29, xu.xin16, ye.xingchen,
tang.dongxing, tzimmermann
On Mon, Mar 31, 2025 at 05:28:45PM +0800, shao.mingyin@zte.com.cn wrote:
> From: Tang Dongxing <tang.dongxing@zte.com.cn>
>
> Remove the custom device comparison function compare_dev and replace it
> with the existing kernel helper component_compare_of
>
> Signed-off-by: Tang Dongxing <tang.dongxing@zte.com.cn>
> Signed-off-by: Shao Mingyin <shao.mingyin@zte.com.cn>
> ---
> drivers/gpu/drm/adp/adp_drv.c | 7 +------
> 1 file changed, 1 insertion(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/adp/adp_drv.c b/drivers/gpu/drm/adp/adp_drv.c
> index c98c647f981d..32350c1a5c1f 100644
> --- a/drivers/gpu/drm/adp/adp_drv.c
> +++ b/drivers/gpu/drm/adp/adp_drv.c
> @@ -551,11 +551,6 @@ static const struct component_master_ops adp_master_ops = {
> .unbind = adp_drm_unbind,
> };
>
> -static int compare_dev(struct device *dev, void *data)
> -{
> - return dev->of_node == data;
> -}
> -
> static int adp_probe(struct platform_device *pdev)
> {
> struct device_node *port;
> @@ -579,7 +574,7 @@ static int adp_probe(struct platform_device *pdev)
> if (!port)
> return -ENODEV;
>
> - drm_of_component_match_add(&pdev->dev, &match, compare_dev, port);
> + drm_of_component_match_add(&pdev->dev, &match, component_compare_of, port);
> of_node_put(port);
>
> return component_master_add_with_match(&pdev->dev, &adp_master_ops, match);
Reviewied-by: Janne Grunau <j@jannau.net>
thanks,
Janne
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 2/4] drm: arm: hdlcd: Replace custom compare_dev with component_compare_of
2025-03-31 9:25 [PATCH 0/4] Replace custom compare_dev with component_compare_of in drm shao.mingyin
2025-03-31 9:28 ` [PATCH 1/4] drm: adp: Replace custom compare_dev with component_compare_of shao.mingyin
@ 2025-03-31 9:30 ` shao.mingyin
2025-04-01 21:11 ` Liviu Dudau
2025-03-31 9:31 ` [PATCH 3/4] drm: malidp: " shao.mingyin
2025-03-31 9:32 ` [PATCH 4/4] drm: mediatek: " shao.mingyin
3 siblings, 1 reply; 8+ messages in thread
From: shao.mingyin @ 2025-03-31 9:30 UTC (permalink / raw)
To: j, liviu.dudau, chunkuang.hu
Cc: fnkl.kernel, maarten.lankhorst, mripard, tzimmermann, airlied,
simona, dri-devel, asahi, linux-kernel, p.zabel, matthias.bgg,
angelogioacchino.delregno, linux-mediatek, linux-arm-kernel,
yang.yang29, xu.xin16, ye.xingchen, tang.dongxing
From: Tang Dongxing <tang.dongxing@zte.com.cn>
Remove the custom device comparison function compare_dev and replace it
with the existing kernel helper component_compare_of
Signed-off-by: Tang Dongxing <tang.dongxing@zte.com.cn>
Signed-off-by: Shao Mingyin <shao.mingyin@zte.com.cn>
---
drivers/gpu/drm/arm/hdlcd_drv.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/arm/hdlcd_drv.c b/drivers/gpu/drm/arm/hdlcd_drv.c
index c3179d74f3f5..45b1dc5613bf 100644
--- a/drivers/gpu/drm/arm/hdlcd_drv.c
+++ b/drivers/gpu/drm/arm/hdlcd_drv.c
@@ -346,11 +346,6 @@ static const struct component_master_ops hdlcd_master_ops = {
.unbind = hdlcd_drm_unbind,
};
-static int compare_dev(struct device *dev, void *data)
-{
- return dev->of_node == data;
-}
-
static int hdlcd_probe(struct platform_device *pdev)
{
struct device_node *port;
@@ -361,7 +356,7 @@ static int hdlcd_probe(struct platform_device *pdev)
if (!port)
return -ENODEV;
- drm_of_component_match_add(&pdev->dev, &match, compare_dev, port);
+ drm_of_component_match_add(&pdev->dev, &match, component_compare_of, port);
of_node_put(port);
return component_master_add_with_match(&pdev->dev, &hdlcd_master_ops,
--
2.25.1
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH 2/4] drm: arm: hdlcd: Replace custom compare_dev with component_compare_of
2025-03-31 9:30 ` [PATCH 2/4] drm: arm: hdlcd: " shao.mingyin
@ 2025-04-01 21:11 ` Liviu Dudau
0 siblings, 0 replies; 8+ messages in thread
From: Liviu Dudau @ 2025-04-01 21:11 UTC (permalink / raw)
To: shao.mingyin
Cc: j, chunkuang.hu, fnkl.kernel, maarten.lankhorst, mripard,
tzimmermann, airlied, simona, dri-devel, asahi, linux-kernel,
p.zabel, matthias.bgg, angelogioacchino.delregno, linux-mediatek,
linux-arm-kernel, yang.yang29, xu.xin16, ye.xingchen,
tang.dongxing
On Mon, Mar 31, 2025 at 05:30:18PM +0800, shao.mingyin@zte.com.cn wrote:
> From: Tang Dongxing <tang.dongxing@zte.com.cn>
>
> Remove the custom device comparison function compare_dev and replace it
> with the existing kernel helper component_compare_of
>
> Signed-off-by: Tang Dongxing <tang.dongxing@zte.com.cn>
> Signed-off-by: Shao Mingyin <shao.mingyin@zte.com.cn>
Reviewed-by: Liviu Dudau <liviu.dudau@arm.com>
Best regards,
Liviu Dudau
> ---
> drivers/gpu/drm/arm/hdlcd_drv.c | 7 +------
> 1 file changed, 1 insertion(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/arm/hdlcd_drv.c b/drivers/gpu/drm/arm/hdlcd_drv.c
> index c3179d74f3f5..45b1dc5613bf 100644
> --- a/drivers/gpu/drm/arm/hdlcd_drv.c
> +++ b/drivers/gpu/drm/arm/hdlcd_drv.c
> @@ -346,11 +346,6 @@ static const struct component_master_ops hdlcd_master_ops = {
> .unbind = hdlcd_drm_unbind,
> };
>
> -static int compare_dev(struct device *dev, void *data)
> -{
> - return dev->of_node == data;
> -}
> -
> static int hdlcd_probe(struct platform_device *pdev)
> {
> struct device_node *port;
> @@ -361,7 +356,7 @@ static int hdlcd_probe(struct platform_device *pdev)
> if (!port)
> return -ENODEV;
>
> - drm_of_component_match_add(&pdev->dev, &match, compare_dev, port);
> + drm_of_component_match_add(&pdev->dev, &match, component_compare_of, port);
> of_node_put(port);
>
> return component_master_add_with_match(&pdev->dev, &hdlcd_master_ops,
> --
> 2.25.1
--
====================
| I would like to |
| fix the world, |
| but they're not |
| giving me the |
\ source code! /
---------------
¯\_(ツ)_/¯
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 3/4] drm: malidp: Replace custom compare_dev with component_compare_of
2025-03-31 9:25 [PATCH 0/4] Replace custom compare_dev with component_compare_of in drm shao.mingyin
2025-03-31 9:28 ` [PATCH 1/4] drm: adp: Replace custom compare_dev with component_compare_of shao.mingyin
2025-03-31 9:30 ` [PATCH 2/4] drm: arm: hdlcd: " shao.mingyin
@ 2025-03-31 9:31 ` shao.mingyin
2025-04-01 21:12 ` Liviu Dudau
2025-03-31 9:32 ` [PATCH 4/4] drm: mediatek: " shao.mingyin
3 siblings, 1 reply; 8+ messages in thread
From: shao.mingyin @ 2025-03-31 9:31 UTC (permalink / raw)
To: j, liviu.dudau, chunkuang.hu
Cc: fnkl.kernel, maarten.lankhorst, mripard, tzimmermann, airlied,
simona, dri-devel, asahi, linux-kernel, p.zabel, matthias.bgg,
angelogioacchino.delregno, linux-mediatek, linux-arm-kernel,
yang.yang29, xu.xin16, ye.xingchen, tang.dongxing
From: Tang Dongxing <tang.dongxing@zte.com.cn>
Remove the custom device comparison function compare_dev and replace it
with the existing kernel helper component_compare_of
Signed-off-by: Tang Dongxing <tang.dongxing@zte.com.cn>
Signed-off-by: Shao Mingyin <shao.mingyin@zte.com.cn>
---
drivers/gpu/drm/arm/malidp_drv.c | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/drivers/gpu/drm/arm/malidp_drv.c b/drivers/gpu/drm/arm/malidp_drv.c
index e083021e9e99..e2e6fd1f64b0 100644
--- a/drivers/gpu/drm/arm/malidp_drv.c
+++ b/drivers/gpu/drm/arm/malidp_drv.c
@@ -910,13 +910,6 @@ static const struct component_master_ops malidp_master_ops = {
.unbind = malidp_unbind,
};
-static int malidp_compare_dev(struct device *dev, void *data)
-{
- struct device_node *np = data;
-
- return dev->of_node == np;
-}
-
static int malidp_platform_probe(struct platform_device *pdev)
{
struct device_node *port;
@@ -930,7 +923,7 @@ static int malidp_platform_probe(struct platform_device *pdev)
if (!port)
return -ENODEV;
- drm_of_component_match_add(&pdev->dev, &match, malidp_compare_dev,
+ drm_of_component_match_add(&pdev->dev, &match, component_compare_of,
port);
of_node_put(port);
return component_master_add_with_match(&pdev->dev, &malidp_master_ops,
--
2.25.1
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH 3/4] drm: malidp: Replace custom compare_dev with component_compare_of
2025-03-31 9:31 ` [PATCH 3/4] drm: malidp: " shao.mingyin
@ 2025-04-01 21:12 ` Liviu Dudau
0 siblings, 0 replies; 8+ messages in thread
From: Liviu Dudau @ 2025-04-01 21:12 UTC (permalink / raw)
To: shao.mingyin
Cc: j, chunkuang.hu, fnkl.kernel, maarten.lankhorst, mripard,
tzimmermann, airlied, simona, dri-devel, asahi, linux-kernel,
p.zabel, matthias.bgg, angelogioacchino.delregno, linux-mediatek,
linux-arm-kernel, yang.yang29, xu.xin16, ye.xingchen,
tang.dongxing
On Mon, Mar 31, 2025 at 05:31:24PM +0800, shao.mingyin@zte.com.cn wrote:
> From: Tang Dongxing <tang.dongxing@zte.com.cn>
>
> Remove the custom device comparison function compare_dev and replace it
> with the existing kernel helper component_compare_of
>
> Signed-off-by: Tang Dongxing <tang.dongxing@zte.com.cn>
> Signed-off-by: Shao Mingyin <shao.mingyin@zte.com.cn>
Reviewed-by: Liviu Dudau <liviu.dudau@arm.com>
Best regards,
Liviu
> ---
> drivers/gpu/drm/arm/malidp_drv.c | 9 +--------
> 1 file changed, 1 insertion(+), 8 deletions(-)
>
> diff --git a/drivers/gpu/drm/arm/malidp_drv.c b/drivers/gpu/drm/arm/malidp_drv.c
> index e083021e9e99..e2e6fd1f64b0 100644
> --- a/drivers/gpu/drm/arm/malidp_drv.c
> +++ b/drivers/gpu/drm/arm/malidp_drv.c
> @@ -910,13 +910,6 @@ static const struct component_master_ops malidp_master_ops = {
> .unbind = malidp_unbind,
> };
>
> -static int malidp_compare_dev(struct device *dev, void *data)
> -{
> - struct device_node *np = data;
> -
> - return dev->of_node == np;
> -}
> -
> static int malidp_platform_probe(struct platform_device *pdev)
> {
> struct device_node *port;
> @@ -930,7 +923,7 @@ static int malidp_platform_probe(struct platform_device *pdev)
> if (!port)
> return -ENODEV;
>
> - drm_of_component_match_add(&pdev->dev, &match, malidp_compare_dev,
> + drm_of_component_match_add(&pdev->dev, &match, component_compare_of,
> port);
> of_node_put(port);
> return component_master_add_with_match(&pdev->dev, &malidp_master_ops,
> --
> 2.25.1
--
====================
| I would like to |
| fix the world, |
| but they're not |
| giving me the |
\ source code! /
---------------
¯\_(ツ)_/¯
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 4/4] drm: mediatek: Replace custom compare_dev with component_compare_of
2025-03-31 9:25 [PATCH 0/4] Replace custom compare_dev with component_compare_of in drm shao.mingyin
` (2 preceding siblings ...)
2025-03-31 9:31 ` [PATCH 3/4] drm: malidp: " shao.mingyin
@ 2025-03-31 9:32 ` shao.mingyin
3 siblings, 0 replies; 8+ messages in thread
From: shao.mingyin @ 2025-03-31 9:32 UTC (permalink / raw)
To: j, liviu.dudau, chunkuang.hu
Cc: fnkl.kernel, maarten.lankhorst, mripard, tzimmermann, airlied,
simona, dri-devel, asahi, linux-kernel, p.zabel, matthias.bgg,
angelogioacchino.delregno, linux-mediatek, linux-arm-kernel,
yang.yang29, xu.xin16, ye.xingchen, tang.dongxing
From: Tang Dongxing <tang.dongxing@zte.com.cn>
Remove the custom device comparison function compare_dev and replace it
with the existing kernel helper component_compare_of
Signed-off-by: Tang Dongxing <tang.dongxing@zte.com.cn>
Signed-off-by: Shao Mingyin <shao.mingyin@zte.com.cn>
---
drivers/gpu/drm/mediatek/mtk_drm_drv.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/mediatek/mtk_drm_drv.c b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
index 74158b9d6503..e1fbb0fe0597 100644
--- a/drivers/gpu/drm/mediatek/mtk_drm_drv.c
+++ b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
@@ -627,11 +627,6 @@ static const struct drm_driver mtk_drm_driver = {
.minor = DRIVER_MINOR,
};
-static int compare_dev(struct device *dev, void *data)
-{
- return dev == (struct device *)data;
-}
-
static int mtk_drm_bind(struct device *dev)
{
struct mtk_drm_private *private = dev_get_drvdata(dev);
@@ -1119,7 +1114,7 @@ static int mtk_drm_probe(struct platform_device *pdev)
private->ddp_comp[DDP_COMPONENT_DRM_OVL_ADAPTOR].dev = &ovl_adaptor->dev;
mtk_ddp_comp_init(NULL, &private->ddp_comp[DDP_COMPONENT_DRM_OVL_ADAPTOR],
DDP_COMPONENT_DRM_OVL_ADAPTOR);
- component_match_add(dev, &match, compare_dev, &ovl_adaptor->dev);
+ component_match_add(dev, &match, component_compare_of, &ovl_adaptor->dev);
}
/* Iterate over sibling DISP function blocks */
--
2.25.1
^ permalink raw reply [flat|nested] 8+ messages in thread