diff options
author | Ville Syrjälä <ville.syrjala@nokia.com> | 2010-03-17 14:58:03 -0400 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@nokia.com> | 2010-08-03 08:18:46 -0400 |
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 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) | |||
198 | 198 | ||
199 | rg = ofbi->region; | 199 | rg = ofbi->region; |
200 | 200 | ||
201 | /* FIXME probably should be a rwsem ... */ | 201 | down_write(&rg->lock); |
202 | mutex_lock(&rg->mtx); | ||
203 | while (rg->ref) { | ||
204 | mutex_unlock(&rg->mtx); | ||
205 | schedule(); | ||
206 | mutex_lock(&rg->mtx); | ||
207 | } | ||
208 | 202 | ||
209 | if (atomic_read(&rg->map_count)) { | 203 | if (atomic_read(&rg->map_count)) { |
210 | r = -EBUSY; | 204 | r = -EBUSY; |
@@ -235,7 +229,7 @@ static int omapfb_setup_mem(struct fb_info *fbi, struct omapfb_mem_info *mi) | |||
235 | } | 229 | } |
236 | 230 | ||
237 | out: | 231 | out: |
238 | mutex_unlock(&rg->mtx); | 232 | up_write(&rg->lock); |
239 | 233 | ||
240 | return r; | 234 | return r; |
241 | } | 235 | } |