summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorKim, Milo <Milo.Kim@ti.com>2013-02-21 16:44:07 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2013-02-21 17:22:25 -0800
commit9e9cdc89695d04359e2d67521199156549c12eb4 (patch)
treeef138967a9b80c34f6c3c73ad194250bfa9520a8 /drivers
parent26e8ccc223ebfd2047a96074f142544dc7062cfe (diff)
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/backlight/lp855x_bl.c24
1 files changed, 0 insertions, 24 deletions
diff --git a/drivers/video/backlight/lp855x_bl.c b/drivers/video/backlight/lp855x_bl.c
index edd2041b1527..7ae9ae6f4655 100644
--- a/drivers/video/backlight/lp855x_bl.c
+++ b/drivers/video/backlight/lp855x_bl.c
@@ -66,20 +66,6 @@ struct lp855x {
struct pwm_device *pwm;
};
-static int lp855x_read_byte(struct lp855x *lp, u8 reg, u8 *data)
-{
- int ret;
-
- ret = i2c_smbus_read_byte_data(lp->client, reg);
- if (ret < 0) {
- dev_err(lp->dev, "failed to read 0x%.2x\n", reg);
- return ret;
- }
-
- *data = (u8)ret;
- return 0;
-}
-
static int lp855x_write_byte(struct lp855x *lp, u8 reg, u8 data)
{
return i2c_smbus_write_byte_data(lp->client, reg, data);
@@ -274,16 +260,6 @@ static int lp855x_bl_update_status(struct backlight_device *bl)
static int lp855x_bl_get_brightness(struct backlight_device *bl)
{
- struct lp855x *lp = bl_get_data(bl);
- enum lp855x_brightness_ctrl_mode mode = lp->pdata->mode;
-
- if (mode == REGISTER_BASED) {
- u8 val = 0;
-
- lp855x_read_byte(lp, lp->cfg->reg_brightness, &val);
- bl->props.brightness = val;
- }
-
return bl->props.brightness;
}