Merge branch 'video' into release
authorLen Brown <len.brown@intel.com>
Sun, 5 Apr 2009 05:40:06 +0000 (01:40 -0400)
committerLen Brown <len.brown@intel.com>
Sun, 5 Apr 2009 05:40:06 +0000 (01:40 -0400)
Conflicts:
drivers/acpi/video.c

Signed-off-by: Len Brown <len.brown@intel.com>
1  2 
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;
  }