aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/processor_thermal.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-04-05 14:16:25 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-04-05 14:16:25 -0400
commit32fb6c17566ec66de87324a834c7776f40e35e78 (patch)
tree87b8ed5d66495536fbb452255c3eacd1cfb0c43a /drivers/acpi/processor_thermal.c
parent45e36c1666aa6c8b0c538abcf984b336184d8c3f (diff)
parent7ec0a7290797f57b780f792d12f4bcc19c83aa4f (diff)
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6
* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6: (140 commits) ACPI: processor: use .notify method instead of installing handler directly ACPI: button: use .notify method instead of installing handler directly ACPI: support acpi_device_ops .notify methods toshiba-acpi: remove MAINTAINERS entry ACPI: battery: asynchronous init acer-wmi: Update copyright notice & documentation acer-wmi: Cleanup the failure cleanup handling acer-wmi: Blacklist Acer Aspire One video: build fix thinkpad-acpi: rework brightness support thinkpad-acpi: enhanced debugging messages for the fan subdriver thinkpad-acpi: enhanced debugging messages for the hotkey subdriver thinkpad-acpi: enhanced debugging messages for rfkill subdrivers thinkpad-acpi: restrict access to some firmware LEDs thinkpad-acpi: remove HKEY disable functionality thinkpad-acpi: add new debug helpers and warn of deprecated atts thinkpad-acpi: add missing log levels thinkpad-acpi: cleanup debug helpers thinkpad-acpi: documentation cleanup thinkpad-acpi: drop ibm-acpi alias ...
Diffstat (limited to 'drivers/acpi/processor_thermal.c')
-rw-r--r--drivers/acpi/processor_thermal.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/drivers/acpi/processor_thermal.c b/drivers/acpi/processor_thermal.c
index b1eb376fae45..39838c666032 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}
375static int 375static int
376processor_get_max_state(struct thermal_cooling_device *cdev, char *buf) 376processor_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
387static int 389static int
388processor_get_cur_state(struct thermal_cooling_device *cdev, char *buf) 390processor_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
404static int 405static int
405processor_set_cur_state(struct thermal_cooling_device *cdev, unsigned int state) 406processor_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
510struct file_operations acpi_processor_limit_fops = { 512const 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,