From: Jacek Anaszewski <jacek.anaszewski@gmail.com>
To: Daniel Mack <daniel@zonque.org>
Cc: linux-leds@vger.kernel.org
Subject: Re: [PATCH] drivers: leds: tlc591xx: check error during device init
Date: Thu, 19 Sep 2019 22:26:44 +0200 [thread overview]
Message-ID: <90e00401-3903-f65d-e670-1ffa28e59e22@gmail.com> (raw)
In-Reply-To: <20190913180749.25740-1-daniel@zonque.org>
Hi Daniel,
Thank you for the patch.
On 9/13/19 8:07 PM, Daniel Mack wrote:
> The driver currently ignores errors from register writes at probe time.
> It will hence register an LED class device no matter whether the
> pyhsical device is present or not.
>
> To fix this, make the device probe fail in case regmap operations
> return an error.
>
> Signed-off-by: Daniel Mack <daniel@zonque.org>
> ---
> drivers/leds/leds-tlc591xx.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/leds/leds-tlc591xx.c b/drivers/leds/leds-tlc591xx.c
> index 59ff088c7d75..00702824d27c 100644
> --- a/drivers/leds/leds-tlc591xx.c
> +++ b/drivers/leds/leds-tlc591xx.c
> @@ -147,7 +147,10 @@ tlc591xx_configure(struct device *dev,
> unsigned int i;
> int err = 0;
>
> - tlc591xx_set_mode(priv->regmap, MODE2_DIM);
> + err = tlc591xx_set_mode(priv->regmap, MODE2_DIM);
> + if (err < 0)
> + return err;
> +
> for (i = 0; i < TLC591XX_MAX_LEDS; i++) {
> struct tlc591xx_led *led = &priv->leds[i];
>
>
Applied.
--
Best regards,
Jacek Anaszewski
prev parent reply other threads:[~2019-09-19 20:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-13 18:07 [PATCH] drivers: leds: tlc591xx: check error during device init Daniel Mack
2019-09-15 16:52 ` Pavel Machek
2019-09-19 20:26 ` Jacek Anaszewski [this message]
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=90e00401-3903-f65d-e670-1ffa28e59e22@gmail.com \
--to=jacek.anaszewski@gmail.com \
--cc=daniel@zonque.org \
--cc=linux-leds@vger.kernel.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).