linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: ye.xingchen@zte.com.cn, p.zabel@pengutronix.de
Cc: daniel@ffwll.ch, festevam@gmail.com, s.hauer@pengutronix.de,
	linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
	linux-imx@nxp.com, kernel@pengutronix.de, airlied@gmail.com,
	shawnguo@kernel.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH linux-next] drm/imx: Use device_match_of_node()
Date: Mon, 28 Nov 2022 10:03:21 +0100	[thread overview]
Message-ID: <49cee522-261f-da9e-6869-60e68da3e0f2@pengutronix.de> (raw)
In-Reply-To: <202211171511333735699@zte.com.cn>

Hello,

On 17.11.22 08:11, ye.xingchen@zte.com.cn wrote:
> From: ye xingchen <ye.xingchen@zte.com.cn>
> 
> Replace the open-code with device_match_of_node().

device_match_of_node() exists so a pointer to the function can be passed
to class/driver_find_device. I see no reason to call it directly.

I don't think you should pursue any patches, where you do this
transformation even if they pass a compile test unlike the patch here.

Thanks,
Ahmad

> 
> Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
> ---
>  drivers/gpu/drm/imx/imx-drm-core.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/imx/imx-drm-core.c b/drivers/gpu/drm/imx/imx-drm-core.c
> index e060fa6cbcb9..2e4f5af894b0 100644
> --- a/drivers/gpu/drm/imx/imx-drm-core.c
> +++ b/drivers/gpu/drm/imx/imx-drm-core.c
> @@ -182,7 +182,7 @@ static int compare_of(struct device *dev, void *data)
>  	if (strcmp(dev->driver->name, "imx-ipuv3-crtc") == 0) {
>  		struct ipu_client_platformdata *pdata = dev->platform_data;
> 
> -		return pdata->of_node == np;
> +		return device_match_of_node(pdata, np);
>  	}
> 
>  	/* Special case for LDB, one device for two channels */
> @@ -191,7 +191,7 @@ static int compare_of(struct device *dev, void *data)
>  		of_node_put(np);
>  	}
> 
> -	return dev->of_node == np;
> +	return device_match_of_node(dev, np);
>  }
> 
>  static int imx_drm_bind(struct device *dev)

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |


      parent reply	other threads:[~2022-11-28  9:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-17  7:11 [PATCH linux-next] drm/imx: Use device_match_of_node() ye.xingchen
2022-11-20 10:54 ` kernel test robot
2022-11-28  9:03 ` Ahmad Fatoum [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49cee522-261f-da9e-6869-60e68da3e0f2@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=airlied@gmail.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=festevam@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=p.zabel@pengutronix.de \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --cc=ye.xingchen@zte.com.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).