dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Sam Ravnborg <sam@ravnborg.org>,
	Daniel Vetter <daniel.vetter@ffwll.ch>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	David Lechner <david@lechnology.com>,
	David Airlie <airlied@linux.ie>,
	Kamlesh Gurudasani <kamlesh.gurudasani@gmail.com>
Subject: [PATCH v1 7/7] drm/hx8357d: Avoid spamming logs if probe is deferred
Date: Wed, 21 Apr 2021 19:31:57 +0300	[thread overview]
Message-ID: <20210421163157.50949-7-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20210421163157.50949-1-andriy.shevchenko@linux.intel.com>

The GPIO request can fail and probe may be deferred. Thus,
the error message may be printed again and again. Avoid
this by replacing DRM_DEV_ERROR() by dev_err_probe().

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/gpu/drm/tiny/hx8357d.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/tiny/hx8357d.c b/drivers/gpu/drm/tiny/hx8357d.c
index c6525cd02bc2..17b2a3cb4918 100644
--- a/drivers/gpu/drm/tiny/hx8357d.c
+++ b/drivers/gpu/drm/tiny/hx8357d.c
@@ -234,10 +234,8 @@ static int hx8357d_probe(struct spi_device *spi)
 	drm = &dbidev->drm;
 
 	dc = devm_gpiod_get(dev, "dc", GPIOD_OUT_LOW);
-	if (IS_ERR(dc)) {
-		DRM_DEV_ERROR(dev, "Failed to get gpio 'dc'\n");
-		return PTR_ERR(dc);
-	}
+	if (IS_ERR(dc))
+		return dev_err_probe(dev, PTR_ERR(dc), "Failed to get GPIO 'dc'\n");
 
 	dbidev->backlight = devm_of_find_backlight(dev);
 	if (IS_ERR(dbidev->backlight))
-- 
2.30.2

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2021-04-21 16:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-21 16:31 [PATCH v1 1/7] drm/st7735r: Avoid spamming logs if probe is deferred Andy Shevchenko
2021-04-21 16:31 ` [PATCH v1 2/7] drm/st7586: " Andy Shevchenko
2021-04-21 16:31 ` [PATCH v1 3/7] drm/mi0283qt: " Andy Shevchenko
2021-04-21 16:31 ` [PATCH v1 4/7] drm/ili9486: " Andy Shevchenko
2021-04-21 16:31 ` [PATCH v1 5/7] drm/ili9341: " Andy Shevchenko
2021-04-21 16:31 ` [PATCH v1 6/7] drm/ili9225: " Andy Shevchenko
2021-04-21 16:31 ` Andy Shevchenko [this message]
2021-04-27 11:27 ` [PATCH v1 1/7] drm/st7735r: " Noralf Trønnes

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=20210421163157.50949-7-andriy.shevchenko@linux.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=airlied@linux.ie \
    --cc=daniel.vetter@ffwll.ch \
    --cc=david@lechnology.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kamlesh.gurudasani@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sam@ravnborg.org \
    /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).