[PATCH 4/5] leds: lp8860: Remove unused read of STATUS register

Andrew Davis
2026-03-05T20:37:16Z

This register is read but the contents are never checked, remove
the read until we add status checking. While here add an error
message should the preceding fault check fail.

Signed-off-by: Andrew Davis <afd@ti.com>
---
drivers/leds/leds-lp8860.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/leds/leds-lp8860.c b/drivers/leds/leds-lp8860.c
index 16129ae94d65f..6d1c9434e6d17 100644
--- a/drivers/leds/leds-lp8860.c
+++ b/drivers/leds/leds-lp8860.c
@@ -185,18 +185,15 @@ static int lp8860_brightness_set(struct led_classdev *led_cdev,

static int lp8860_program_eeprom(struct lp8860_led *led)
{
- unsigned int read_buf;
int ret, reg_count;

guard(mutex)(&led->lock);

ret = lp8860_fault_check(led);
- if (ret)
- return ret;
-
- ret = regmap_read(led->regmap, LP8860_STATUS, &read_buf);
- if (ret)
+ if (ret) {
+ dev_err(&led->client->dev, "Cannot read/clear faults\n");
return ret;
+ }

ret = regmap_write(led->regmap, LP8860_EEPROM_UNLOCK, LP8860_EEPROM_CODE_1);
if (ret) {
--
2.39.2