diff options
author | Kim, Milo <Milo.Kim@ti.com> | 2012-12-17 19:00:45 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-12-17 20:15:16 -0500 |
commit | eaa4d02fbaf49e57f8a18f68e736e34c514030a2 (patch) | |
tree | 9c9655309d7fa519713c277e9f7dd190ceda1c39 /drivers/video | |
parent | 8cc9764c9c7d01a6e2c3ddac8f0ac7716be01868 (diff) |
drivers/video/backlight/lp855x_bl.c: remove unnecessary mutex code
The mutex for accessing lp855x registers is used in case of the user-space
interaction. When the brightness is changed via sysfs, the mutex is
required. But the backlight class device already provides it. Thus, the
lp855x mutex is unnecessary.
Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com>
Cc: Thierry Reding <thierry.reding@avionic-design.de>
Cc: Richard Purdie <rpurdie@rpsys.net>
Cc: Bryan Wu <bryan.wu@canonical.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/backlight/lp855x_bl.c | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/drivers/video/backlight/lp855x_bl.c b/drivers/video/backlight/lp855x_bl.c index b437541555ff..6e4db0c874c8 100644 --- a/drivers/video/backlight/lp855x_bl.c +++ b/drivers/video/backlight/lp855x_bl.c | |||
@@ -35,7 +35,6 @@ struct lp855x { | |||
35 | struct i2c_client *client; | 35 | struct i2c_client *client; |
36 | struct backlight_device *bl; | 36 | struct backlight_device *bl; |
37 | struct device *dev; | 37 | struct device *dev; |
38 | struct mutex xfer_lock; | ||
39 | struct lp855x_platform_data *pdata; | 38 | struct lp855x_platform_data *pdata; |
40 | struct pwm_device *pwm; | 39 | struct pwm_device *pwm; |
41 | }; | 40 | }; |
@@ -44,14 +43,11 @@ static int lp855x_read_byte(struct lp855x *lp, u8 reg, u8 *data) | |||
44 | { | 43 | { |
45 | int ret; | 44 | int ret; |
46 | 45 | ||
47 | mutex_lock(&lp->xfer_lock); | ||
48 | ret = i2c_smbus_read_byte_data(lp->client, reg); | 46 | ret = i2c_smbus_read_byte_data(lp->client, reg); |
49 | if (ret < 0) { | 47 | if (ret < 0) { |
50 | mutex_unlock(&lp->xfer_lock); | ||
51 | dev_err(lp->dev, "failed to read 0x%.2x\n", reg); | 48 | dev_err(lp->dev, "failed to read 0x%.2x\n", reg); |
52 | return ret; | 49 | return ret; |
53 | } | 50 | } |
54 | mutex_unlock(&lp->xfer_lock); | ||
55 | 51 | ||
56 | *data = (u8)ret; | 52 | *data = (u8)ret; |
57 | return 0; | 53 | return 0; |
@@ -59,13 +55,7 @@ static int lp855x_read_byte(struct lp855x *lp, u8 reg, u8 *data) | |||
59 | 55 | ||
60 | static int lp855x_write_byte(struct lp855x *lp, u8 reg, u8 data) | 56 | static int lp855x_write_byte(struct lp855x *lp, u8 reg, u8 data) |
61 | { | 57 | { |
62 | int ret; | 58 | return i2c_smbus_write_byte_data(lp->client, reg, data); |
63 | |||
64 | mutex_lock(&lp->xfer_lock); | ||
65 | ret = i2c_smbus_write_byte_data(lp->client, reg, data); | ||
66 | mutex_unlock(&lp->xfer_lock); | ||
67 | |||
68 | return ret; | ||
69 | } | 59 | } |
70 | 60 | ||
71 | static bool lp855x_is_valid_rom_area(struct lp855x *lp, u8 addr) | 61 | static bool lp855x_is_valid_rom_area(struct lp855x *lp, u8 addr) |
@@ -281,8 +271,6 @@ static int lp855x_probe(struct i2c_client *cl, const struct i2c_device_id *id) | |||
281 | lp->chip_id = id->driver_data; | 271 | lp->chip_id = id->driver_data; |
282 | i2c_set_clientdata(cl, lp); | 272 | i2c_set_clientdata(cl, lp); |
283 | 273 | ||
284 | mutex_init(&lp->xfer_lock); | ||
285 | |||
286 | ret = lp855x_init_registers(lp); | 274 | ret = lp855x_init_registers(lp); |
287 | if (ret) { | 275 | if (ret) { |
288 | dev_err(lp->dev, "i2c communication err: %d", ret); | 276 | dev_err(lp->dev, "i2c communication err: %d", ret); |