diff options
author | Ville Syrjälä <ville.syrjala@nokia.com> | 2010-03-17 20:58:03 +0200 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@nokia.com> | 2010-08-03 15:18:46 +0300 |
commit | 2f642a17503838e256b8b7e9f1153512e2efc38b (patch) | |
tree | cdf6fb1fb815543d7adb0ce78db87ddc68a822c7 /drivers/video/omap2/omapfb/omapfb-ioctl.c | |
parent | 430571d59a0b51c6541c153ad8b08e72fef26098 (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-ioctl.c')
-rw-r--r-- | drivers/video/omap2/omapfb/omapfb-ioctl.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/video/omap2/omapfb/omapfb-ioctl.c b/drivers/video/omap2/omapfb/omapfb-ioctl.c index 69bcbfca47f..3a10146dc12 100644 --- a/drivers/video/omap2/omapfb/omapfb-ioctl.c +++ b/drivers/video/omap2/omapfb/omapfb-ioctl.c @@ -198,13 +198,7 @@ static int omapfb_setup_mem(struct fb_info *fbi, struct omapfb_mem_info *mi) rg = ofbi->region; - /* FIXME probably should be a rwsem ... */ - mutex_lock(&rg->mtx); - while (rg->ref) { - mutex_unlock(&rg->mtx); - schedule(); - mutex_lock(&rg->mtx); - } + down_write(&rg->lock); if (atomic_read(&rg->map_count)) { r = -EBUSY; @@ -235,7 +229,7 @@ static int omapfb_setup_mem(struct fb_info *fbi, struct omapfb_mem_info *mi) } out: - mutex_unlock(&rg->mtx); + up_write(&rg->lock); return r; } |