Skip to content

Commit b9604be

Browse files
Su Huilag-linaro
authored andcommitted
leds: lp5521: Add an error check in lp5521_post_init_device
lp55xx_write() can return an error code, add a check for this. Signed-off-by: Su Hui <suhui@nfschina.com> Link: https://lore.kernel.org/r/20231020091930.207870-1-suhui@nfschina.com Signed-off-by: Lee Jones <lee@kernel.org>
1 parent 2038d3f commit b9604be

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/leds/leds-lp5521.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,8 @@ static int lp5521_post_init_device(struct lp55xx_chip *chip)
301301

302302
/* Set all PWMs to direct control mode */
303303
ret = lp55xx_write(chip, LP5521_REG_OP_MODE, LP5521_CMD_DIRECT);
304+
if (ret)
305+
return ret;
304306

305307
/* Update configuration for the clock setting */
306308
val = LP5521_DEFAULT_CFG;

0 commit comments

Comments
 (0)