mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] drm/mediatek: Replace custom compare_dev with component_compare_of
@ 2025-04-03  7:54 shao.mingyin
  2025-04-03 10:21 ` AngeloGioacchino Del Regno
  0 siblings, 1 reply; 2+ messages in thread
From: shao.mingyin @ 2025-04-03  7:54 UTC (permalink / raw)
  To: chunkuang.hu
  Cc: p.zabel, airlied, simona, matthias.bgg,
	angelogioacchino.delregno, dri-devel, linux-mediatek,
	linux-kernel, 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_disp_ovl_adaptor.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/mediatek/mtk_disp_ovl_adaptor.c b/drivers/gpu/drm/mediatek/mtk_disp_ovl_adaptor.c
index fa0e95dd29a0..fe97bb97e004 100644
--- a/drivers/gpu/drm/mediatek/mtk_disp_ovl_adaptor.c
+++ b/drivers/gpu/drm/mediatek/mtk_disp_ovl_adaptor.c
@@ -492,11 +492,6 @@ static const struct of_device_id mtk_ovl_adaptor_comp_dt_ids[] = {
 	{ /* sentinel */ }
 };

-static int compare_of(struct device *dev, void *data)
-{
-	return dev->of_node == data;
-}
-
 static int ovl_adaptor_of_get_ddp_comp_type(struct device_node *node,
 					    enum mtk_ovl_adaptor_comp_type *ctype)
 {
@@ -567,7 +562,7 @@ static int ovl_adaptor_comp_init(struct device *dev, struct component_match **ma

 		priv->ovl_adaptor_comp[id] = &comp_pdev->dev;

-		drm_of_component_match_add(dev, match, compare_of, node);
+		drm_of_component_match_add(dev, match, component_compare_of, node);
 		dev_dbg(dev, "Adding component match for %pOF\n", node);
 	}

-- 
2.25.1

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] drm/mediatek: Replace custom compare_dev with component_compare_of
  2025-04-03  7:54 [PATCH] drm/mediatek: Replace custom compare_dev with component_compare_of shao.mingyin
@ 2025-04-03 10:21 ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 2+ messages in thread
From: AngeloGioacchino Del Regno @ 2025-04-03 10:21 UTC (permalink / raw)
  To: shao.mingyin, chunkuang.hu
  Cc: p.zabel, airlied, simona, matthias.bgg, dri-devel,
	linux-mediatek, linux-kernel, linux-arm-kernel, yang.yang29,
	xu.xin16, ye.xingchen, tang.dongxing

Il 03/04/25 09:54, shao.mingyin@zte.com.cn ha scritto:
> 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: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>

> ---
>   drivers/gpu/drm/mediatek/mtk_disp_ovl_adaptor.c | 7 +------
>   1 file changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/mediatek/mtk_disp_ovl_adaptor.c b/drivers/gpu/drm/mediatek/mtk_disp_ovl_adaptor.c
> index fa0e95dd29a0..fe97bb97e004 100644
> --- a/drivers/gpu/drm/mediatek/mtk_disp_ovl_adaptor.c
> +++ b/drivers/gpu/drm/mediatek/mtk_disp_ovl_adaptor.c
> @@ -492,11 +492,6 @@ static const struct of_device_id mtk_ovl_adaptor_comp_dt_ids[] = {
>   	{ /* sentinel */ }
>   };
> 
> -static int compare_of(struct device *dev, void *data)
> -{
> -	return dev->of_node == data;
> -}
> -
>   static int ovl_adaptor_of_get_ddp_comp_type(struct device_node *node,
>   					    enum mtk_ovl_adaptor_comp_type *ctype)
>   {
> @@ -567,7 +562,7 @@ static int ovl_adaptor_comp_init(struct device *dev, struct component_match **ma
> 
>   		priv->ovl_adaptor_comp[id] = &comp_pdev->dev;
> 
> -		drm_of_component_match_add(dev, match, compare_of, node);
> +		drm_of_component_match_add(dev, match, component_compare_of, node);
>   		dev_dbg(dev, "Adding component match for %pOF\n", node);
>   	}
> 



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-04-03 10:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-03  7:54 [PATCH] drm/mediatek: Replace custom compare_dev with component_compare_of shao.mingyin
2025-04-03 10:21 ` AngeloGioacchino Del Regno

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®