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: "Eric Anholt" <eric@anholt.net>, "David Airlie" <airlied@linux.ie>, "Daniel Vetter" <daniel@ffwll.ch>, "David Lechner" <david@lechnology.com>, "Kamlesh Gurudasani" <kamlesh.gurudasani@gmail.com>, "Noralf Trønnes" <noralf@tronnes.org>, "Andy Shevchenko" <andriy.shevchenko@linux.intel.com> Subject: [PATCH v1 6/7] drm/ili9225: Avoid spamming logs if probe is deferred Date: Wed, 21 Apr 2021 19:31:56 +0300 [thread overview] Message-ID: <20210421163157.50949-6-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/ili9225.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/tiny/ili9225.c b/drivers/gpu/drm/tiny/ili9225.c index 8e98962db5a2..db89cced67df 100644 --- a/drivers/gpu/drm/tiny/ili9225.c +++ b/drivers/gpu/drm/tiny/ili9225.c @@ -379,16 +379,12 @@ static int ili9225_probe(struct spi_device *spi) drm = &dbidev->drm; dbi->reset = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH); - if (IS_ERR(dbi->reset)) { - DRM_DEV_ERROR(dev, "Failed to get gpio 'reset'\n"); - return PTR_ERR(dbi->reset); - } + if (IS_ERR(dbi->reset)) + return dev_err_probe(dev, PTR_ERR(dbi->reset), "Failed to get GPIO 'reset'\n"); rs = devm_gpiod_get(dev, "rs", GPIOD_OUT_LOW); - if (IS_ERR(rs)) { - DRM_DEV_ERROR(dev, "Failed to get gpio 'rs'\n"); - return PTR_ERR(rs); - } + if (IS_ERR(rs)) + return dev_err_probe(dev, PTR_ERR(rs), "Failed to get GPIO 'rs'\n"); device_property_read_u32(dev, "rotation", &rotation); -- 2.30.2
WARNING: multiple messages have this Message-ID (diff)
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 6/7] drm/ili9225: Avoid spamming logs if probe is deferred Date: Wed, 21 Apr 2021 19:31:56 +0300 [thread overview] Message-ID: <20210421163157.50949-6-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/ili9225.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/tiny/ili9225.c b/drivers/gpu/drm/tiny/ili9225.c index 8e98962db5a2..db89cced67df 100644 --- a/drivers/gpu/drm/tiny/ili9225.c +++ b/drivers/gpu/drm/tiny/ili9225.c @@ -379,16 +379,12 @@ static int ili9225_probe(struct spi_device *spi) drm = &dbidev->drm; dbi->reset = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH); - if (IS_ERR(dbi->reset)) { - DRM_DEV_ERROR(dev, "Failed to get gpio 'reset'\n"); - return PTR_ERR(dbi->reset); - } + if (IS_ERR(dbi->reset)) + return dev_err_probe(dev, PTR_ERR(dbi->reset), "Failed to get GPIO 'reset'\n"); rs = devm_gpiod_get(dev, "rs", GPIOD_OUT_LOW); - if (IS_ERR(rs)) { - DRM_DEV_ERROR(dev, "Failed to get gpio 'rs'\n"); - return PTR_ERR(rs); - } + if (IS_ERR(rs)) + return dev_err_probe(dev, PTR_ERR(rs), "Failed to get GPIO 'rs'\n"); device_property_read_u32(dev, "rotation", &rotation); -- 2.30.2 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2021-04-21 16:32 UTC|newest] Thread overview: 16+ 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 ` Andy Shevchenko 2021-04-21 16:31 ` [PATCH v1 2/7] drm/st7586: " Andy Shevchenko 2021-04-21 16:31 ` Andy Shevchenko 2021-04-21 16:31 ` [PATCH v1 3/7] drm/mi0283qt: " Andy Shevchenko 2021-04-21 16:31 ` Andy Shevchenko 2021-04-21 16:31 ` [PATCH v1 4/7] drm/ili9486: " Andy Shevchenko 2021-04-21 16:31 ` Andy Shevchenko 2021-04-21 16:31 ` [PATCH v1 5/7] drm/ili9341: " Andy Shevchenko 2021-04-21 16:31 ` Andy Shevchenko 2021-04-21 16:31 ` Andy Shevchenko [this message] 2021-04-21 16:31 ` [PATCH v1 6/7] drm/ili9225: " Andy Shevchenko 2021-04-21 16:31 ` [PATCH v1 7/7] drm/hx8357d: " Andy Shevchenko 2021-04-21 16:31 ` Andy Shevchenko 2021-04-27 11:27 ` [PATCH v1 1/7] drm/st7735r: " Noralf Trønnes 2021-04-27 11:27 ` 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-6-andriy.shevchenko@linux.intel.com \ --to=andriy.shevchenko@linux.intel.com \ --cc=airlied@linux.ie \ --cc=daniel.vetter@ffwll.ch \ --cc=daniel@ffwll.ch \ --cc=david@lechnology.com \ --cc=dri-devel@lists.freedesktop.org \ --cc=eric@anholt.net \ --cc=kamlesh.gurudasani@gmail.com \ --cc=linux-kernel@vger.kernel.org \ --cc=noralf@tronnes.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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.