Commit b46d2b4d authored by Daniel Mack's avatar Daniel Mack Committed by Pavel

drivers: leds: tlc591xx: check error during device init

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: default avatarDaniel Mack <daniel@zonque.org>
Signed-off-by: default avatarPavel Machek <pavel@ucw.cz>
parent fc19967b
...@@ -147,7 +147,10 @@ tlc591xx_configure(struct device *dev, ...@@ -147,7 +147,10 @@ tlc591xx_configure(struct device *dev,
unsigned int i; unsigned int i;
int err = 0; 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++) { for (i = 0; i < TLC591XX_MAX_LEDS; i++) {
struct tlc591xx_led *led = &priv->leds[i]; struct tlc591xx_led *led = &priv->leds[i];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment