From: Len Brown Date: Sun, 5 Apr 2009 05:40:06 +0000 (-0400) Subject: Merge branch 'video' into release X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=12648810506eaa063dc23b66514fbb4796f34312;p=linux-2.6-omap-h63xx.git Merge branch 'video' into release Conflicts: drivers/acpi/video.c Signed-off-by: Len Brown --- 12648810506eaa063dc23b66514fbb4796f34312 diff --cc drivers/acpi/video.c index 5259d502add,ae427100a1e..100c8eeaa5d --- a/drivers/acpi/video.c +++ b/drivers/acpi/video.c @@@ -374,14 -385,14 +388,15 @@@ static int video_get_cur_state(struct t struct acpi_device *device = cdev->devdata; struct acpi_video_device *video = acpi_driver_data(device); unsigned long long level; - int state; + int offset; - acpi_video_device_lcd_get_level_current(video, &level); + if (acpi_video_device_lcd_get_level_current(video, &level)) + return -EINVAL; - for (state = 2; state < video->brightness->count; state++) - if (level == video->brightness->levels[state]) - return sprintf(buf, "%d\n", - video->brightness->count - state - 1); + for (offset = 2; offset < video->brightness->count; offset++) + if (level == video->brightness->levels[offset]) { + *state = video->brightness->count - offset - 1; + return 0; + } return -EINVAL; }