diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/char/rtc.c | 5 | ||||
-rw-r--r-- | drivers/media/video/videodev.c | 2 | ||||
-rw-r--r-- | drivers/video/fbsysfs.c | 12 |
3 files changed, 16 insertions, 3 deletions
diff --git a/drivers/char/rtc.c b/drivers/char/rtc.c index 6e6a7c7a7eff..ab6429b4a84e 100644 --- a/drivers/char/rtc.c +++ b/drivers/char/rtc.c | |||
@@ -209,11 +209,12 @@ static const unsigned char days_in_mo[] = | |||
209 | */ | 209 | */ |
210 | static inline unsigned char rtc_is_updating(void) | 210 | static inline unsigned char rtc_is_updating(void) |
211 | { | 211 | { |
212 | unsigned long flags; | ||
212 | unsigned char uip; | 213 | unsigned char uip; |
213 | 214 | ||
214 | spin_lock_irq(&rtc_lock); | 215 | spin_lock_irqsave(&rtc_lock, flags); |
215 | uip = (CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP); | 216 | uip = (CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP); |
216 | spin_unlock_irq(&rtc_lock); | 217 | spin_unlock_irqrestore(&rtc_lock, flags); |
217 | return uip; | 218 | return uip; |
218 | } | 219 | } |
219 | 220 | ||
diff --git a/drivers/media/video/videodev.c b/drivers/media/video/videodev.c index 88bf2af2a0e7..edd7b83c3464 100644 --- a/drivers/media/video/videodev.c +++ b/drivers/media/video/videodev.c | |||
@@ -836,7 +836,7 @@ static int __video_do_ioctl(struct inode *inode, struct file *file, | |||
836 | break; | 836 | break; |
837 | } | 837 | } |
838 | 838 | ||
839 | if (index<=0 || index >= vfd->tvnormsize) { | 839 | if (index < 0 || index >= vfd->tvnormsize) { |
840 | ret=-EINVAL; | 840 | ret=-EINVAL; |
841 | break; | 841 | break; |
842 | } | 842 | } |
diff --git a/drivers/video/fbsysfs.c b/drivers/video/fbsysfs.c index 4f78f234473d..c151dcf68786 100644 --- a/drivers/video/fbsysfs.c +++ b/drivers/video/fbsysfs.c | |||
@@ -397,6 +397,12 @@ static ssize_t store_bl_curve(struct class_device *class_device, | |||
397 | u8 tmp_curve[FB_BACKLIGHT_LEVELS]; | 397 | u8 tmp_curve[FB_BACKLIGHT_LEVELS]; |
398 | unsigned int i; | 398 | unsigned int i; |
399 | 399 | ||
400 | /* Some drivers don't use framebuffer_alloc(), but those also | ||
401 | * don't have backlights. | ||
402 | */ | ||
403 | if (!fb_info || !fb_info->bl_dev) | ||
404 | return -ENODEV; | ||
405 | |||
400 | if (count != (FB_BACKLIGHT_LEVELS / 8 * 24)) | 406 | if (count != (FB_BACKLIGHT_LEVELS / 8 * 24)) |
401 | return -EINVAL; | 407 | return -EINVAL; |
402 | 408 | ||
@@ -430,6 +436,12 @@ static ssize_t show_bl_curve(struct class_device *class_device, char *buf) | |||
430 | ssize_t len = 0; | 436 | ssize_t len = 0; |
431 | unsigned int i; | 437 | unsigned int i; |
432 | 438 | ||
439 | /* Some drivers don't use framebuffer_alloc(), but those also | ||
440 | * don't have backlights. | ||
441 | */ | ||
442 | if (!fb_info || !fb_info->bl_dev) | ||
443 | return -ENODEV; | ||
444 | |||
433 | mutex_lock(&fb_info->bl_mutex); | 445 | mutex_lock(&fb_info->bl_mutex); |
434 | for (i = 0; i < FB_BACKLIGHT_LEVELS; i += 8) | 446 | for (i = 0; i < FB_BACKLIGHT_LEVELS; i += 8) |
435 | len += snprintf(&buf[len], PAGE_SIZE, | 447 | len += snprintf(&buf[len], PAGE_SIZE, |