aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2/omapfb/omapfb-ioctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/omap2/omapfb/omapfb-ioctl.c')
-rw-r--r--drivers/video/omap2/omapfb/omapfb-ioctl.c10
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 69bcbfca47f6..3a10146dc120 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;
}

Privacy Policy