During the cleanup, Dan Carpenter's patch was removed. This patch recovers his patch based on the latest lp5521 driver. [PATCH] leds: leds-lp5521: return an error code on error in probe() If "buf" wasn't equal to LP5521_REG_R_CURR_DEFAULT the probe fails but we still return zero. I've changed it to print an error message and return -EINVAL. Cc: Dan Carpenter <dan.carpenter@xxxxxxxxxx> Signed-off-by: Milo(Woogyom) Kim <milo.kim@xxxxxx> --- drivers/leds/leds-lp5521.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/leds/leds-lp5521.c b/drivers/leds/leds-lp5521.c index 23d0bee..9de5aec 100644 --- a/drivers/leds/leds-lp5521.c +++ b/drivers/leds/leds-lp5521.c @@ -278,11 +278,18 @@ static int lp5521_post_init_device(struct lp55xx_chip *chip) * LP5521_REG_ENABLE register will not have any effect - strange! */ ret = lp55xx_read(chip, LP5521_REG_R_CURRENT, &val); - if (ret || val != LP5521_REG_R_CURR_DEFAULT) { + if (ret) { dev_err(&chip->cl->dev, "error in resetting chip\n"); return ret; } + if (val != LP5521_REG_R_CURR_DEFAULT) { + dev_err(&chip->cl->dev, + "unexpected data in register (expected 0x%x got 0x%x)\n", + LP5521_REG_R_CURR_DEFAULT, val); + return -EINVAL; + } + usleep_range(10000, 20000); /* Set all PWMs to direct control mode */ -- 1.7.9.5 Best Regards, Milo -- To unsubscribe from this list: send the line "unsubscribe linux-leds" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html