From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Dan Murphy <dmurphy@ti.com>,
linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Pavel Machek <pavel@ucw.cz>
Subject: [PATCH v1 1/7] leds: lp50xx: Don't spam logs when probe is deferred
Date: Tue, 16 Feb 2021 17:50:44 +0200 [thread overview]
Message-ID: <20210216155050.29322-1-andriy.shevchenko@linux.intel.com> (raw)
When requesting GPIO line the probe can be deferred.
In such case don't spam logs with an error message.
This can be achieved by switching to dev_err_probe().
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/leds/leds-lp50xx.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/leds/leds-lp50xx.c b/drivers/leds/leds-lp50xx.c
index f13117eed976..a2d18ec8fd2b 100644
--- a/drivers/leds/leds-lp50xx.c
+++ b/drivers/leds/leds-lp50xx.c
@@ -455,12 +455,9 @@ static int lp50xx_probe_dt(struct lp50xx *priv)
int i = 0;
priv->enable_gpio = devm_gpiod_get_optional(priv->dev, "enable", GPIOD_OUT_LOW);
- if (IS_ERR(priv->enable_gpio)) {
- ret = PTR_ERR(priv->enable_gpio);
- dev_err(&priv->client->dev, "Failed to get enable gpio: %d\n",
- ret);
- return ret;
- }
+ if (IS_ERR(priv->enable_gpio))
+ return dev_err_probe(priv->dev, PTR_ERR(priv->enable_gpio),
+ "Failed to get enable GPIO\n");
priv->regulator = devm_regulator_get(priv->dev, "vled");
if (IS_ERR(priv->regulator))
--
2.30.0
next reply other threads:[~2021-02-16 15:54 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-16 15:50 Andy Shevchenko [this message]
2021-02-16 15:50 ` [PATCH v1 2/7] leds: lp50xx: Switch to new style i2c-driver probe function Andy Shevchenko
2021-02-16 15:50 ` [PATCH v1 3/7] leds: lp50xx: Reduce level of dereferences Andy Shevchenko
2021-02-16 15:50 ` [PATCH v1 4/7] leds: lp50xx: Get rid of redundant explicit casting Andy Shevchenko
2021-02-16 15:50 ` [PATCH v1 5/7] leds: lp50xx: Get rid of redundant check in lp50xx_enable_disable() Andy Shevchenko
2021-02-16 15:50 ` [PATCH v1 6/7] leds: lp50xx: Add missed bits.h and convert to BIT() Andy Shevchenko
2021-02-19 11:27 ` Pavel Machek
2021-02-19 13:42 ` Andy Shevchenko
2021-02-16 15:50 ` [PATCH v1 7/7] leds: lp50xx: Update headers block to reflect reality Andy Shevchenko
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=20210216155050.29322-1-andriy.shevchenko@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=dmurphy@ti.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=pavel@ucw.cz \
/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