X-Git-Url: http://ftp.safe.ca/?a=blobdiff_plain;f=drivers%2Facpi%2Fprocessor_thermal.c;h=39838c66603265bd188f398b07fdd494a0699589;hb=f001a70cdc61c01452d42e8b32fd7c7842ef62d5;hp=1f31699359baac765454098dd277e701f4ea7985;hpb=070d8eb1f6b789206486ea6a4a1bb7745d86d314;p=safe%2Fjmp%2Flinux-2.6 diff --git a/drivers/acpi/processor_thermal.c b/drivers/acpi/processor_thermal.c index 1f31699..39838c6 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) return max_state; } static int -processor_get_max_state(struct thermal_cooling_device *cdev, char *buf) +processor_get_max_state(struct thermal_cooling_device *cdev, + unsigned long *state) { struct acpi_device *device = cdev->devdata; struct acpi_processor *pr = acpi_driver_data(device); @@ -381,28 +382,29 @@ processor_get_max_state(struct thermal_cooling_device *cdev, char *buf) if (!device || !pr) return -EINVAL; - return sprintf(buf, "%d\n", acpi_processor_max_state(pr)); + *state = acpi_processor_max_state(pr); + return 0; } static int -processor_get_cur_state(struct thermal_cooling_device *cdev, char *buf) +processor_get_cur_state(struct thermal_cooling_device *cdev, + unsigned long *cur_state) { struct acpi_device *device = cdev->devdata; struct acpi_processor *pr = acpi_driver_data(device); - int cur_state; if (!device || !pr) return -EINVAL; - cur_state = cpufreq_get_cur_state(pr->id); + *cur_state = cpufreq_get_cur_state(pr->id); if (pr->flags.throttling) - cur_state += pr->throttling.state; - - return sprintf(buf, "%d\n", cur_state); + *cur_state += pr->throttling.state; + return 0; } static int -processor_set_cur_state(struct thermal_cooling_device *cdev, unsigned int state) +processor_set_cur_state(struct thermal_cooling_device *cdev, + unsigned long state) { struct acpi_device *device = cdev->devdata; struct acpi_processor *pr = acpi_driver_data(device);