aboutsummaryrefslogtreecommitdiff
path: root/drivers/acpi/video.c
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2009-04-05 01:39:12 -0400
committerLen Brown <len.brown@intel.com>2009-04-05 01:39:12 -0400
commit4f3bff70a64b105921dac8630bc4381567b21ebd (patch)
tree2601d581e21c4ca9392bbf85dfb981a2181ecba6 /drivers/acpi/video.c
parent2ddb9f17ba026122b53b34fb4182ece91e24cf92 (diff)
parent03a971a2899886006f19f3495973bbd646d8bdae (diff)
Merge branch 'thermal' into release
Diffstat (limited to 'drivers/acpi/video.c')
-rw-r--r--drivers/acpi/video.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
index bb5ed059114..5259d502add 100644
--- a/drivers/acpi/video.c
+++ b/drivers/acpi/video.c
@@ -358,32 +358,36 @@ 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;
acpi_video_device_lcd_get_level_current(video, &level);
- 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);