diff options
Diffstat (limited to 'drivers/acpi/processor_thermal.c')
-rw-r--r-- | drivers/acpi/processor_thermal.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/drivers/acpi/processor_thermal.c b/drivers/acpi/processor_thermal.c index b1eb376fae4..39838c66603 100644 --- a/drivers/acpi/processor_thermal.c +++ b/drivers/acpi/processor_thermal.c | |||
@@ -373,7 +373,8 @@ static int acpi_processor_max_state(struct acpi_processor *pr) | |||
373 | return max_state; | 373 | return max_state; |
374 | } | 374 | } |
375 | static int | 375 | static int |
376 | processor_get_max_state(struct thermal_cooling_device *cdev, char *buf) | 376 | processor_get_max_state(struct thermal_cooling_device *cdev, |
377 | unsigned long *state) | ||
377 | { | 378 | { |
378 | struct acpi_device *device = cdev->devdata; | 379 | struct acpi_device *device = cdev->devdata; |
379 | struct acpi_processor *pr = acpi_driver_data(device); | 380 | struct acpi_processor *pr = acpi_driver_data(device); |
@@ -381,28 +382,29 @@ processor_get_max_state(struct thermal_cooling_device *cdev, char *buf) | |||
381 | if (!device || !pr) | 382 | if (!device || !pr) |
382 | return -EINVAL; | 383 | return -EINVAL; |
383 | 384 | ||
384 | return sprintf(buf, "%d\n", acpi_processor_max_state(pr)); | 385 | *state = acpi_processor_max_state(pr); |
386 | return 0; | ||
385 | } | 387 | } |
386 | 388 | ||
387 | static int | 389 | static int |
388 | processor_get_cur_state(struct thermal_cooling_device *cdev, char *buf) | 390 | processor_get_cur_state(struct thermal_cooling_device *cdev, |
391 | unsigned long *cur_state) | ||
389 | { | 392 | { |
390 | struct acpi_device *device = cdev->devdata; | 393 | struct acpi_device *device = cdev->devdata; |
391 | struct acpi_processor *pr = acpi_driver_data(device); | 394 | struct acpi_processor *pr = acpi_driver_data(device); |
392 | int cur_state; | ||
393 | 395 | ||
394 | if (!device || !pr) | 396 | if (!device || !pr) |
395 | return -EINVAL; | 397 | return -EINVAL; |
396 | 398 | ||
397 | cur_state = cpufreq_get_cur_state(pr->id); | 399 | *cur_state = cpufreq_get_cur_state(pr->id); |
398 | if (pr->flags.throttling) | 400 | if (pr->flags.throttling) |
399 | cur_state += pr->throttling.state; | 401 | *cur_state += pr->throttling.state; |
400 | 402 | return 0; | |
401 | return sprintf(buf, "%d\n", cur_state); | ||
402 | } | 403 | } |
403 | 404 | ||
404 | static int | 405 | static int |
405 | processor_set_cur_state(struct thermal_cooling_device *cdev, unsigned int state) | 406 | processor_set_cur_state(struct thermal_cooling_device *cdev, |
407 | unsigned long state) | ||
406 | { | 408 | { |
407 | struct acpi_device *device = cdev->devdata; | 409 | struct acpi_device *device = cdev->devdata; |
408 | struct acpi_processor *pr = acpi_driver_data(device); | 410 | struct acpi_processor *pr = acpi_driver_data(device); |
@@ -507,7 +509,7 @@ static ssize_t acpi_processor_write_limit(struct file * file, | |||
507 | return count; | 509 | return count; |
508 | } | 510 | } |
509 | 511 | ||
510 | struct file_operations acpi_processor_limit_fops = { | 512 | const struct file_operations acpi_processor_limit_fops = { |
511 | .owner = THIS_MODULE, | 513 | .owner = THIS_MODULE, |
512 | .open = acpi_processor_limit_open_fs, | 514 | .open = acpi_processor_limit_open_fs, |
513 | .read = seq_read, | 515 | .read = seq_read, |