Merge branch 'video' into release
[linux-2.6.git] / drivers / acpi / video.c
index ae42710..100c8ee 100644 (file)
@@ -372,33 +372,37 @@ static struct output_properties acpi_output_properties = {
 
 
 /* thermal cooling device callbacks */
-static int video_get_max_state(struct thermal_cooling_device *cdev, char *buf)
+static int video_get_max_state(struct thermal_cooling_device *cdev, unsigned
+                              long *state)
 {
        struct acpi_device *device = cdev->devdata;
        struct acpi_video_device *video = acpi_driver_data(device);
 
-       return sprintf(buf, "%d\n", video->brightness->count - 3);
+       *state = video->brightness->count - 3;
+       return 0;
 }
 
-static int video_get_cur_state(struct thermal_cooling_device *cdev, char *buf)
+static int video_get_cur_state(struct thermal_cooling_device *cdev, unsigned
+                              long *state)
 {
        struct acpi_device *device = cdev->devdata;
        struct acpi_video_device *video = acpi_driver_data(device);
        unsigned long long level;
-       int state;
+       int offset;
 
        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;
 }
 
 static int
-video_set_cur_state(struct thermal_cooling_device *cdev, unsigned int state)
+video_set_cur_state(struct thermal_cooling_device *cdev, unsigned long state)
 {
        struct acpi_device *device = cdev->devdata;
        struct acpi_video_device *video = acpi_driver_data(device);