diff options
Diffstat (limited to 'drivers/video/omap2/omapfb/omapfb-sysfs.c')
-rw-r--r-- | drivers/video/omap2/omapfb/omapfb-sysfs.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/drivers/video/omap2/omapfb/omapfb-sysfs.c b/drivers/video/omap2/omapfb/omapfb-sysfs.c index 62bb88f5c192..5179219128bd 100644 --- a/drivers/video/omap2/omapfb/omapfb-sysfs.c +++ b/drivers/video/omap2/omapfb/omapfb-sysfs.c | |||
@@ -57,7 +57,8 @@ static ssize_t store_rotate_type(struct device *dev, | |||
57 | if (rot_type != OMAP_DSS_ROT_DMA && rot_type != OMAP_DSS_ROT_VRFB) | 57 | if (rot_type != OMAP_DSS_ROT_DMA && rot_type != OMAP_DSS_ROT_VRFB) |
58 | return -EINVAL; | 58 | return -EINVAL; |
59 | 59 | ||
60 | lock_fb_info(fbi); | 60 | if (!lock_fb_info(fbi)) |
61 | return -ENODEV; | ||
61 | 62 | ||
62 | r = 0; | 63 | r = 0; |
63 | if (rot_type == ofbi->rotation_type) | 64 | if (rot_type == ofbi->rotation_type) |
@@ -105,7 +106,8 @@ static ssize_t store_mirror(struct device *dev, | |||
105 | if (mirror != 0 && mirror != 1) | 106 | if (mirror != 0 && mirror != 1) |
106 | return -EINVAL; | 107 | return -EINVAL; |
107 | 108 | ||
108 | lock_fb_info(fbi); | 109 | if (!lock_fb_info(fbi)) |
110 | return -ENODEV; | ||
109 | 111 | ||
110 | ofbi->mirror = mirror; | 112 | ofbi->mirror = mirror; |
111 | 113 | ||
@@ -137,8 +139,9 @@ static ssize_t show_overlays(struct device *dev, | |||
137 | ssize_t l = 0; | 139 | ssize_t l = 0; |
138 | int t; | 140 | int t; |
139 | 141 | ||
142 | if (!lock_fb_info(fbi)) | ||
143 | return -ENODEV; | ||
140 | omapfb_lock(fbdev); | 144 | omapfb_lock(fbdev); |
141 | lock_fb_info(fbi); | ||
142 | 145 | ||
143 | for (t = 0; t < ofbi->num_overlays; t++) { | 146 | for (t = 0; t < ofbi->num_overlays; t++) { |
144 | struct omap_overlay *ovl = ofbi->overlays[t]; | 147 | struct omap_overlay *ovl = ofbi->overlays[t]; |
@@ -154,8 +157,8 @@ static ssize_t show_overlays(struct device *dev, | |||
154 | 157 | ||
155 | l += snprintf(buf + l, PAGE_SIZE - l, "\n"); | 158 | l += snprintf(buf + l, PAGE_SIZE - l, "\n"); |
156 | 159 | ||
157 | unlock_fb_info(fbi); | ||
158 | omapfb_unlock(fbdev); | 160 | omapfb_unlock(fbdev); |
161 | unlock_fb_info(fbi); | ||
159 | 162 | ||
160 | return l; | 163 | return l; |
161 | } | 164 | } |
@@ -195,8 +198,9 @@ static ssize_t store_overlays(struct device *dev, struct device_attribute *attr, | |||
195 | if (buf[len - 1] == '\n') | 198 | if (buf[len - 1] == '\n') |
196 | len = len - 1; | 199 | len = len - 1; |
197 | 200 | ||
201 | if (!lock_fb_info(fbi)) | ||
202 | return -ENODEV; | ||
198 | omapfb_lock(fbdev); | 203 | omapfb_lock(fbdev); |
199 | lock_fb_info(fbi); | ||
200 | 204 | ||
201 | if (len > 0) { | 205 | if (len > 0) { |
202 | char *p = (char *)buf; | 206 | char *p = (char *)buf; |
@@ -303,8 +307,8 @@ static ssize_t store_overlays(struct device *dev, struct device_attribute *attr, | |||
303 | 307 | ||
304 | r = count; | 308 | r = count; |
305 | out: | 309 | out: |
306 | unlock_fb_info(fbi); | ||
307 | omapfb_unlock(fbdev); | 310 | omapfb_unlock(fbdev); |
311 | unlock_fb_info(fbi); | ||
308 | 312 | ||
309 | return r; | 313 | return r; |
310 | } | 314 | } |
@@ -317,7 +321,8 @@ static ssize_t show_overlays_rotate(struct device *dev, | |||
317 | ssize_t l = 0; | 321 | ssize_t l = 0; |
318 | int t; | 322 | int t; |
319 | 323 | ||
320 | lock_fb_info(fbi); | 324 | if (!lock_fb_info(fbi)) |
325 | return -ENODEV; | ||
321 | 326 | ||
322 | for (t = 0; t < ofbi->num_overlays; t++) { | 327 | for (t = 0; t < ofbi->num_overlays; t++) { |
323 | l += snprintf(buf + l, PAGE_SIZE - l, "%s%d", | 328 | l += snprintf(buf + l, PAGE_SIZE - l, "%s%d", |
@@ -345,7 +350,8 @@ static ssize_t store_overlays_rotate(struct device *dev, | |||
345 | if (buf[len - 1] == '\n') | 350 | if (buf[len - 1] == '\n') |
346 | len = len - 1; | 351 | len = len - 1; |
347 | 352 | ||
348 | lock_fb_info(fbi); | 353 | if (!lock_fb_info(fbi)) |
354 | return -ENODEV; | ||
349 | 355 | ||
350 | if (len > 0) { | 356 | if (len > 0) { |
351 | char *p = (char *)buf; | 357 | char *p = (char *)buf; |
@@ -416,7 +422,8 @@ static ssize_t store_size(struct device *dev, struct device_attribute *attr, | |||
416 | 422 | ||
417 | size = PAGE_ALIGN(simple_strtoul(buf, NULL, 0)); | 423 | size = PAGE_ALIGN(simple_strtoul(buf, NULL, 0)); |
418 | 424 | ||
419 | lock_fb_info(fbi); | 425 | if (!lock_fb_info(fbi)) |
426 | return -ENODEV; | ||
420 | 427 | ||
421 | for (i = 0; i < ofbi->num_overlays; i++) { | 428 | for (i = 0; i < ofbi->num_overlays; i++) { |
422 | if (ofbi->overlays[i]->info.enabled) { | 429 | if (ofbi->overlays[i]->info.enabled) { |