aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2/omapfb/omapfb-sysfs.c
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@nokia.com>2010-03-17 14:58:03 -0400
committerTomi Valkeinen <tomi.valkeinen@nokia.com>2010-08-03 08:18:46 -0400
commit2f642a17503838e256b8b7e9f1153512e2efc38b (patch)
treecdf6fb1fb815543d7adb0ce78db87ddc68a822c7 /drivers/video/omap2/omapfb/omapfb-sysfs.c
parent430571d59a0b51c6541c153ad8b08e72fef26098 (diff)
OMAP: DSS2: OMAPFB: Convert the memory region locking to rwsem
R/W semaphore is a good fit for the memory region locking pattern. So use it. 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.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/video/omap2/omapfb/omapfb-sysfs.c b/drivers/video/omap2/omapfb/omapfb-sysfs.c
index 74c11b243100..724b760404f2 100644
--- a/drivers/video/omap2/omapfb/omapfb-sysfs.c
+++ b/drivers/video/omap2/omapfb/omapfb-sysfs.c
@@ -452,13 +452,7 @@ static ssize_t store_size(struct device *dev, struct device_attribute *attr,
452 452
453 rg = ofbi->region; 453 rg = ofbi->region;
454 454
455 /* FIXME probably should be a rwsem ... */ 455 down_write(&rg->lock);
456 mutex_lock(&rg->mtx);
457 while (rg->ref) {
458 mutex_unlock(&rg->mtx);
459 schedule();
460 mutex_lock(&rg->mtx);
461 }
462 456
463 if (atomic_read(&rg->map_count)) { 457 if (atomic_read(&rg->map_count)) {
464 r = -EBUSY; 458 r = -EBUSY;
@@ -490,7 +484,7 @@ static ssize_t store_size(struct device *dev, struct device_attribute *attr,
490 484
491 r = count; 485 r = count;
492out: 486out:
493 mutex_unlock(&rg->mtx); 487 up_write(&rg->lock);
494 488
495 unlock_fb_info(fbi); 489 unlock_fb_info(fbi);
496 490