public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Sui Jingfeng <sui.jingfeng@linux.dev>
Cc: Andrzej Hajda <andrzej.hajda@intel.com>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Robert Foss <rfoss@kernel.org>, Jonas Karlman <jonas@kwiboo.se>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm: bridge: thc63lvd1024: Switch to use of_graph_get_remote_node()
Date: Mon, 18 Mar 2024 17:33:26 +0200	[thread overview]
Message-ID: <20240318153326.GD13682@pendragon.ideasonboard.com> (raw)
In-Reply-To: <20240316172800.1168390-1-sui.jingfeng@linux.dev>

Hi Sui,

Thank you for the patch.

On Sun, Mar 17, 2024 at 01:28:00AM +0800, Sui Jingfeng wrote:
> To reduce boilerplate, use of_graph_get_remote_node() helper instead of
> the hand-rolling code.
> 
> Signed-off-by: Sui Jingfeng <sui.jingfeng@linux.dev>
> ---
>  drivers/gpu/drm/bridge/thc63lvd1024.c | 24 +++---------------------
>  1 file changed, 3 insertions(+), 21 deletions(-)
> 
> diff --git a/drivers/gpu/drm/bridge/thc63lvd1024.c b/drivers/gpu/drm/bridge/thc63lvd1024.c
> index d4c1a601bbb5..5f99f9724081 100644
> --- a/drivers/gpu/drm/bridge/thc63lvd1024.c
> +++ b/drivers/gpu/drm/bridge/thc63lvd1024.c
> @@ -123,28 +123,10 @@ static int thc63_parse_dt(struct thc63_dev *thc63)
>  	struct device_node *endpoint;
>  	struct device_node *remote;
>  
> -	endpoint = of_graph_get_endpoint_by_regs(thc63->dev->of_node,
> -						 THC63_RGB_OUT0, -1);
> -	if (!endpoint) {
> -		dev_err(thc63->dev, "Missing endpoint in port@%u\n",
> -			THC63_RGB_OUT0);
> -		return -ENODEV;
> -	}
> -
> -	remote = of_graph_get_remote_port_parent(endpoint);
> -	of_node_put(endpoint);
> -	if (!remote) {
> -		dev_err(thc63->dev, "Endpoint in port@%u unconnected\n",
> -			THC63_RGB_OUT0);
> +	remote = of_graph_get_remote_node(thc63->dev->of_node,
> +					  THC63_RGB_OUT0, -1);
> +	if (!remote)

The old logic is equivalent to of_graph_get_remote_node(), but now the
driver will fail probing without an error message. That's not very nice
as it leads to difficult to debug problems. I would keep one dev_err()
here:

		dev_err(thc63->dev, "No remote endpoint for port@%u\n",
			THC63_RGB_OUT0);

As your patch has been merged already, would you like to post a
follow-up patch to fix this ?

>  		return -ENODEV;
> -	}
> -
> -	if (!of_device_is_available(remote)) {
> -		dev_err(thc63->dev, "port@%u remote endpoint is disabled\n",
> -			THC63_RGB_OUT0);
> -		of_node_put(remote);
> -		return -ENODEV;
> -	}
>  
>  	thc63->next = of_drm_find_bridge(remote);
>  	of_node_put(remote);

-- 
Regards,

Laurent Pinchart

  parent reply	other threads:[~2024-03-18 15:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-16 17:28 [PATCH] drm: bridge: thc63lvd1024: Switch to use of_graph_get_remote_node() Sui Jingfeng
2024-03-16 17:46 ` Dmitry Baryshkov
2024-03-18 15:23 ` Neil Armstrong
2024-03-18 15:33 ` Laurent Pinchart [this message]
2024-03-18 15:53   ` Sui Jingfeng
2024-03-18 15:57     ` Laurent Pinchart
2024-03-18 15:59       ` Sui Jingfeng

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=20240318153326.GD13682@pendragon.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=airlied@gmail.com \
    --cc=andrzej.hajda@intel.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jernej.skrabec@gmail.com \
    --cc=jonas@kwiboo.se \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=rfoss@kernel.org \
    --cc=sui.jingfeng@linux.dev \
    --cc=tzimmermann@suse.de \
    /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