diff options
author | Tomi Valkeinen <tomi.valkeinen@nokia.com> | 2010-04-15 16:41:07 +0300 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@nokia.com> | 2010-08-03 15:18:47 +0300 |
commit | 1cbc8703e1c510a245a7bd5e269987402ffc9e18 (patch) | |
tree | feb9a86ee833d723ffd2e90ee1a7013bc4b01392 /drivers/video/omap2/displays/panel-taal.c | |
parent | 4ffa35713e263fbf4975e14bc6f4a515b7701349 (diff) | |
download | blackbird-op-linux-1cbc8703e1c510a245a7bd5e269987402ffc9e18.tar.gz blackbird-op-linux-1cbc8703e1c510a245a7bd5e269987402ffc9e18.zip |
OMAP: DSS2: Taal: add locks to taal_bl_update_status
taal_bl_update_status was missing locks to protect taal_data. This caused
a kernel crash randomly, as the code attempted to set the brightness while
the OMAP's DSI block was actually disabled.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
Diffstat (limited to 'drivers/video/omap2/displays/panel-taal.c')
-rw-r--r-- | drivers/video/omap2/displays/panel-taal.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/video/omap2/displays/panel-taal.c b/drivers/video/omap2/displays/panel-taal.c index aaf5d308a046..d2e2ac7444e0 100644 --- a/drivers/video/omap2/displays/panel-taal.c +++ b/drivers/video/omap2/displays/panel-taal.c @@ -290,24 +290,26 @@ static int taal_bl_update_status(struct backlight_device *dev) dev_dbg(&dssdev->dev, "update brightness to %d\n", level); + mutex_lock(&td->lock); + if (td->use_dsi_bl) { if (td->enabled) { dsi_bus_lock(); r = taal_dcs_write_1(DCS_BRIGHTNESS, level); dsi_bus_unlock(); - if (r) - return r; + } else { + r = 0; } } else { if (!dssdev->set_backlight) - return -EINVAL; - - r = dssdev->set_backlight(dssdev, level); - if (r) - return r; + r = -EINVAL; + else + r = dssdev->set_backlight(dssdev, level); } - return 0; + mutex_unlock(&td->lock); + + return r; } static int taal_bl_get_intensity(struct backlight_device *dev) |