Skip to content

Commit ca4b5ff

Browse files
glneolag-linaro
authored andcommitted
leds: lp8860: Remove unused read of STATUS register
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> Link: https://patch.msgid.link/20260305203706.841384-4-afd@ti.com Signed-off-by: Lee Jones <lee@kernel.org>
1 parent 67a4a34 commit ca4b5ff

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

drivers/leds/leds-lp8860.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -185,18 +185,15 @@ static int lp8860_brightness_set(struct led_classdev *led_cdev,
185185

186186
static int lp8860_program_eeprom(struct lp8860_led *led)
187187
{
188-
unsigned int read_buf;
189188
int ret, reg_count;
190189

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

193192
ret = lp8860_fault_check(led);
194-
if (ret)
195-
return ret;
196-
197-
ret = regmap_read(led->regmap, LP8860_STATUS, &read_buf);
198-
if (ret)
193+
if (ret) {
194+
dev_err(&led->client->dev, "Cannot read/clear faults\n");
199195
return ret;
196+
}
200197

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

0 commit comments

Comments
 (0)