aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/fbsysfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/fbsysfs.c')
-rw-r--r--drivers/video/fbsysfs.c12
1 files changed, 12 insertions, 0 deletions
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,