Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 35529
b: refs/heads/master
c: 25981de
h: refs/heads/master
i:
  35527: 3082519
v: v3
  • Loading branch information
Michael Hanselmann authored and Linus Torvalds committed Sep 26, 2006
1 parent e37ce0d commit e67a5a4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f3ef9ead31ae995251b420ac98398bd7545bf4e1
refs/heads/master: 25981de5b836581364612a4b1fe27db3b5d1f861
12 changes: 12 additions & 0 deletions trunk/drivers/video/fbsysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,12 @@ static ssize_t store_bl_curve(struct class_device *class_device,
u8 tmp_curve[FB_BACKLIGHT_LEVELS];
unsigned int i;

/* Some drivers don't use framebuffer_alloc(), but those also
* don't have backlights.
*/
if (!fb_info || !fb_info->bl_dev)
return -ENODEV;

if (count != (FB_BACKLIGHT_LEVELS / 8 * 24))
return -EINVAL;

Expand Down Expand Up @@ -430,6 +436,12 @@ static ssize_t show_bl_curve(struct class_device *class_device, char *buf)
ssize_t len = 0;
unsigned int i;

/* Some drivers don't use framebuffer_alloc(), but those also
* don't have backlights.
*/
if (!fb_info || !fb_info->bl_dev)
return -ENODEV;

mutex_lock(&fb_info->bl_mutex);
for (i = 0; i < FB_BACKLIGHT_LEVELS; i += 8)
len += snprintf(&buf[len], PAGE_SIZE,
Expand Down

0 comments on commit e67a5a4

Please sign in to comment.