Skip to content

Commit 4bf7ddd

Browse files
z3ntulag-linaro
authored andcommitted
backlight: lm3630a: Don't set bl->props.brightness in get_brightness
There's no need to set bl->props.brightness, the get_brightness function is just supposed to return the current brightness and not touch the struct. With that done we can also remove the 'goto out' and just return the value. Fixes: 0c2a665 ("backlight: add Backlight driver for lm3630 chip") Signed-off-by: Luca Weiss <[email protected]> Reviewed-by: Daniel Thompson <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Lee Jones <[email protected]>
1 parent ad9aeb0 commit 4bf7ddd

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

drivers/video/backlight/lm3630a_bl.c

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ static int lm3630a_bank_a_get_brightness(struct backlight_device *bl)
233233
if (rval < 0)
234234
goto out_i2c_err;
235235
brightness |= rval;
236-
goto out;
236+
return brightness;
237237
}
238238

239239
/* disable sleep */
@@ -244,11 +244,8 @@ static int lm3630a_bank_a_get_brightness(struct backlight_device *bl)
244244
rval = lm3630a_read(pchip, REG_BRT_A);
245245
if (rval < 0)
246246
goto out_i2c_err;
247-
brightness = rval;
247+
return rval;
248248

249-
out:
250-
bl->props.brightness = brightness;
251-
return bl->props.brightness;
252249
out_i2c_err:
253250
dev_err(pchip->dev, "i2c failed to access register\n");
254251
return 0;
@@ -310,7 +307,7 @@ static int lm3630a_bank_b_get_brightness(struct backlight_device *bl)
310307
if (rval < 0)
311308
goto out_i2c_err;
312309
brightness |= rval;
313-
goto out;
310+
return brightness;
314311
}
315312

316313
/* disable sleep */
@@ -321,11 +318,8 @@ static int lm3630a_bank_b_get_brightness(struct backlight_device *bl)
321318
rval = lm3630a_read(pchip, REG_BRT_B);
322319
if (rval < 0)
323320
goto out_i2c_err;
324-
brightness = rval;
321+
return rval;
325322

326-
out:
327-
bl->props.brightness = brightness;
328-
return bl->props.brightness;
329323
out_i2c_err:
330324
dev_err(pchip->dev, "i2c failed to access register\n");
331325
return 0;

0 commit comments

Comments
 (0)