aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Mack <daniel@zonque.org>2019-09-13 20:07:49 +0200
committerPavel <pavel@ucw.cz>2019-11-03 17:37:13 +0100
commitb46d2b4d3d8166ab51f491a2801e2cbed2e8a7aa (patch)
tree320484770bb58580daf26fc9532d132f0db1f7eb
parentleds: add LED driver for EL15203000 board (diff)
downloadlinux-dev-b46d2b4d3d8166ab51f491a2801e2cbed2e8a7aa.tar.xz
linux-dev-b46d2b4d3d8166ab51f491a2801e2cbed2e8a7aa.zip
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: Daniel Mack <daniel@zonque.org> Signed-off-by: Pavel Machek <pavel@ucw.cz>
-rw-r--r--drivers/leds/leds-tlc591xx.c5
1 files changed, 4 insertions, 1 deletions
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];