summaryrefslogtreecommitdiff
path: root/drivers/leds
diff options
context:
space:
mode:
authorDaniel Mack <daniel@zonque.org>2019-09-13 21:07:49 +0300
committerPavel <pavel@ucw.cz>2019-11-03 19:37:13 +0300
commitb46d2b4d3d8166ab51f491a2801e2cbed2e8a7aa (patch)
tree320484770bb58580daf26fc9532d132f0db1f7eb /drivers/leds
parentfc19967bcb8f1ab49594191ee0d352d763dc170e (diff)
downloadlinux-b46d2b4d3d8166ab51f491a2801e2cbed2e8a7aa.tar.xz
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>
Diffstat (limited to 'drivers/leds')
-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];