Re: [PATCH 3/4] drm: malidp: Replace custom compare_dev with component_compare_of

From: Liviu Dudau
Date: Tue Apr 01 2025 - 17:12:51 EST


On Mon, Mar 31, 2025 at 05:31:24PM +0800, shao.mingyin@xxxxxxxxxx wrote:
> From: Tang Dongxing <tang.dongxing@xxxxxxxxxx>
>
> 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@xxxxxxxxxx>
> Signed-off-by: Shao Mingyin <shao.mingyin@xxxxxxxxxx>

Reviewed-by: Liviu Dudau <liviu.dudau@xxxxxxx>

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! /
---------------
¯\_(ツ)_/¯