public inbox for linux-arm-msm@vger.kernel.org
 help / color / mirror / Atom feed
From: Sam Ravnborg <sam@ravnborg.org>
To: Gaosheng Cui <cuigaosheng1@huawei.com>
Cc: liviu.dudau@arm.com, airlied@gmail.com, daniel@ffwll.ch,
	robdclark@gmail.com, quic_abhinavk@quicinc.com,
	dmitry.baryshkov@linaro.org, sean@poorly.run,
	marijn.suijten@somainline.org, neil.armstrong@linaro.org,
	quic_eberman@quicinc.com, a39.skl@gmail.com,
	quic_gurus@quicinc.com, angelogioacchino.delregno@somainline.org,
	james.qian.wang@arm.com, dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org
Subject: Re: [PATCH v3 1/3] drm/panel: Fix IS_ERR() vs NULL check in nt35950_probe()
Date: Fri, 14 Jul 2023 21:31:48 +0200	[thread overview]
Message-ID: <20230714193148.GA158430@ravnborg.org> (raw)
In-Reply-To: <20230714014820.2186203-2-cuigaosheng1@huawei.com>

Hi Gaosheng,
On Fri, Jul 14, 2023 at 09:48:18AM +0800, Gaosheng Cui wrote:
> The mipi_dsi_device_register_full() returns an ERR_PTR() on failure,
> we should use IS_ERR() to check the return value.

Correct - so the code is indeed wrong.

Can you update it so we print the error code as this can be very
helpful.

And then please use dev_probe_err() too.

	Sam

> 
> Fixes: 623a3531e9cf ("drm/panel: Add driver for Novatek NT35950 DSI DriverIC panels")
> Signed-off-by: Gaosheng Cui <cuigaosheng1@huawei.com>
> ---
>  drivers/gpu/drm/panel/panel-novatek-nt35950.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/panel/panel-novatek-nt35950.c b/drivers/gpu/drm/panel/panel-novatek-nt35950.c
> index 8b108ac80b55..4903bbf1df55 100644
> --- a/drivers/gpu/drm/panel/panel-novatek-nt35950.c
> +++ b/drivers/gpu/drm/panel/panel-novatek-nt35950.c
> @@ -571,7 +571,7 @@ static int nt35950_probe(struct mipi_dsi_device *dsi)
>  		}
>  
>  		nt->dsi[1] = mipi_dsi_device_register_full(dsi_r_host, info);
> -		if (!nt->dsi[1]) {
> +		if (IS_ERR(nt->dsi[1])) {
>  			dev_err(dev, "Cannot get secondary DSI node\n");
>  			return -ENODEV;
>  		}
> -- 
> 2.25.1

  reply	other threads:[~2023-07-14 19:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-14  1:48 [PATCH v3 0/3] Fix IS_ERR() vs NULL check for drm Gaosheng Cui
2023-07-14  1:48 ` [PATCH v3 1/3] drm/panel: Fix IS_ERR() vs NULL check in nt35950_probe() Gaosheng Cui
2023-07-14 19:31   ` Sam Ravnborg [this message]
2023-07-14  1:48 ` [PATCH v3 2/3] drm/msm: Fix IS_ERR() vs NULL check in a5xx_submit_in_rb() Gaosheng Cui
2023-07-14 19:10   ` Abhinav Kumar
2023-07-14 19:17     ` [Freedreno] " Abhinav Kumar
2023-07-14  1:48 ` [PATCH v3 3/3] drm/komeda: Fix IS_ERR() vs NULL check in komeda_component_get_avail_scaler() Gaosheng Cui
2023-07-21 10:24   ` Liviu Dudau
2023-07-24 14:04     ` cuigaosheng

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=20230714193148.GA158430@ravnborg.org \
    --to=sam@ravnborg.org \
    --cc=a39.skl@gmail.com \
    --cc=airlied@gmail.com \
    --cc=angelogioacchino.delregno@somainline.org \
    --cc=cuigaosheng1@huawei.com \
    --cc=daniel@ffwll.ch \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=freedreno@lists.freedesktop.org \
    --cc=james.qian.wang@arm.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=liviu.dudau@arm.com \
    --cc=marijn.suijten@somainline.org \
    --cc=neil.armstrong@linaro.org \
    --cc=quic_abhinavk@quicinc.com \
    --cc=quic_eberman@quicinc.com \
    --cc=quic_gurus@quicinc.com \
    --cc=robdclark@gmail.com \
    --cc=sean@poorly.run \
    /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