Commit 9e9cdc89695d04359e2d67521199156549c12eb4
Committed by
Linus Torvalds
1 parent
26e8ccc223
Exists in
smarc-l5.0.0_1.0.0-ga
and in
5 other branches
backlight: lp855x_bl: simplify bl_get_brightness()
Getting the brightness value is not critical, no need to read the actual register value. To simplify it, just return the 'bl->props.brightness' value. Then, lp855x_read_byte() can be removed, not used any more. Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com> Acked-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Showing 1 changed file with 0 additions and 24 deletions Side-by-side Diff
drivers/video/backlight/lp855x_bl.c
... | ... | @@ -66,20 +66,6 @@ |
66 | 66 | struct pwm_device *pwm; |
67 | 67 | }; |
68 | 68 | |
69 | -static int lp855x_read_byte(struct lp855x *lp, u8 reg, u8 *data) | |
70 | -{ | |
71 | - int ret; | |
72 | - | |
73 | - ret = i2c_smbus_read_byte_data(lp->client, reg); | |
74 | - if (ret < 0) { | |
75 | - dev_err(lp->dev, "failed to read 0x%.2x\n", reg); | |
76 | - return ret; | |
77 | - } | |
78 | - | |
79 | - *data = (u8)ret; | |
80 | - return 0; | |
81 | -} | |
82 | - | |
83 | 69 | static int lp855x_write_byte(struct lp855x *lp, u8 reg, u8 data) |
84 | 70 | { |
85 | 71 | return i2c_smbus_write_byte_data(lp->client, reg, data); |
... | ... | @@ -274,16 +260,6 @@ |
274 | 260 | |
275 | 261 | static int lp855x_bl_get_brightness(struct backlight_device *bl) |
276 | 262 | { |
277 | - struct lp855x *lp = bl_get_data(bl); | |
278 | - enum lp855x_brightness_ctrl_mode mode = lp->pdata->mode; | |
279 | - | |
280 | - if (mode == REGISTER_BASED) { | |
281 | - u8 val = 0; | |
282 | - | |
283 | - lp855x_read_byte(lp, lp->cfg->reg_brightness, &val); | |
284 | - bl->props.brightness = val; | |
285 | - } | |
286 | - | |
287 | 263 | return bl->props.brightness; |
288 | 264 | } |
289 | 265 |