From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
To: Quentin Schulz <foss+kernel@0leil.net>,
Neil Armstrong <neil.armstrong@linaro.org>,
Jessica Zhang <quic_jesszhan@quicinc.com>,
Sam Ravnborg <sam@ravnborg.org>,
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>
Cc: Heiko Stuebner <heiko@sntech.de>,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
Quentin Schulz <quentin.schulz@theobroma-systems.com>
Subject: Re: [PATCH 1/2] drm/panel: ltk050h3146w: only print message when GPIO getting is not EPROBE_DEFER
Date: Thu, 4 Jan 2024 15:09:21 +0100 [thread overview]
Message-ID: <f3a0ca01-f94d-41e2-be1c-a098f3e8c2fa@wanadoo.fr> (raw)
In-Reply-To: <20240104-ltk-dev_err_probe-v1-1-8ef3c0b585d8@theobroma-systems.com>
Le 04/01/2024 à 13:41, Quentin Schulz a écrit :
> From: Quentin Schulz <quentin.schulz@theobroma-systems.com>
>
> devm_gpiod_get_optional may return EPROBE_DEFER in case the GPIO
> controller isn't yet probed when the panel driver is being probed.
>
> In that case, a spurious and confusing error message about not being
> able to get the reset GPIO is printed even though later on the device
> actually manages to get probed.
>
> Use dev_err_probe instead so that the message is only printed when it
> truly matters.
>
> Cc: Quentin Schulz <foss+kernel@0leil.net>
> Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Reviewed-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c b/drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c
> index 30919c872ac8d..ecfa4181c4fd9 100644
> --- a/drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c
> +++ b/drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c
> @@ -646,10 +646,8 @@ static int ltk050h3146w_probe(struct mipi_dsi_device *dsi)
> return -EINVAL;
>
> ctx->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW);
> - if (IS_ERR(ctx->reset_gpio)) {
> - dev_err(dev, "cannot get reset gpio\n");
> - return PTR_ERR(ctx->reset_gpio);
> - }
> + if (IS_ERR(ctx->reset_gpio))
> + return dev_err_probe(dev, PTR_ERR(ctx->reset_gpio), "cannot get reset gpio\n");
>
> ctx->vci = devm_regulator_get(dev, "vci");
> if (IS_ERR(ctx->vci)) {
>
next prev parent reply other threads:[~2024-01-04 14:17 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-04 12:41 [PATCH 0/2] drm/panel: ltk050h3146w: error-path debug message improvements Quentin Schulz
2024-01-04 12:41 ` [PATCH 1/2] drm/panel: ltk050h3146w: only print message when GPIO getting is not EPROBE_DEFER Quentin Schulz
2024-01-04 14:09 ` Christophe JAILLET [this message]
2024-01-04 12:41 ` [PATCH 2/2] drm/panel: ltk050h3146w: use dev_err_probe wherever possible Quentin Schulz
2024-01-04 14:08 ` Christophe JAILLET
2024-01-04 16:14 ` [PATCH 0/2] drm/panel: ltk050h3146w: error-path debug message improvements Heiko Stuebner
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=f3a0ca01-f94d-41e2-be1c-a098f3e8c2fa@wanadoo.fr \
--to=christophe.jaillet@wanadoo.fr \
--cc=airlied@gmail.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=foss+kernel@0leil.net \
--cc=heiko@sntech.de \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=neil.armstrong@linaro.org \
--cc=quentin.schulz@theobroma-systems.com \
--cc=quic_jesszhan@quicinc.com \
--cc=sam@ravnborg.org \
--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
all inboxes | Powered by JetHome®