summaryrefslogtreecommitdiff
path: root/drivers/video/omap2/omapfb/omapfb-sysfs.c
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@nokia.com>2010-03-17 22:28:50 +0300
committerTomi Valkeinen <tomi.valkeinen@nokia.com>2010-08-03 16:18:46 +0400
commit1ceafc00910439c8e5450fae189b69427725992c (patch)
tree5b98fb03b1885dc64b335965bd73686b818e368c /drivers/video/omap2/omapfb/omapfb-sysfs.c
parent3d84b65aa63833a2ac07b1cc626984a1e1485fed (diff)
downloadlinux-1ceafc00910439c8e5450fae189b69427725992c.tar.xz
OMAP: DSS2: OMAPFB: Add some locking debug checks
Trigger WARN_ON() messages from various places in the code in case the memory region is not currently locked. Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
Diffstat (limited to 'drivers/video/omap2/omapfb/omapfb-sysfs.c')
-rw-r--r--drivers/video/omap2/omapfb/omapfb-sysfs.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/video/omap2/omapfb/omapfb-sysfs.c b/drivers/video/omap2/omapfb/omapfb-sysfs.c
index 1e714bb48d39..51c13c366bf3 100644
--- a/drivers/video/omap2/omapfb/omapfb-sysfs.c
+++ b/drivers/video/omap2/omapfb/omapfb-sysfs.c
@@ -453,6 +453,7 @@ static ssize_t store_size(struct device *dev, struct device_attribute *attr,
rg = ofbi->region;
down_write_nested(&rg->lock, rg->id);
+ atomic_inc(&rg->lock_count);
if (atomic_read(&rg->map_count)) {
r = -EBUSY;
@@ -484,6 +485,7 @@ static ssize_t store_size(struct device *dev, struct device_attribute *attr,
r = count;
out:
+ atomic_dec(&rg->lock_count);
up_write(&rg->lock);
unlock_fb_info(fbi);