Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 367609
b: refs/heads/master
c: 99aa363
h: refs/heads/master
i:
  367607: 8675b97
v: v3
  • Loading branch information
Colin Ian King authored and Rafael J. Wysocki committed Mar 25, 2013
1 parent 04514cd commit 68cdff1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f0c29583db51104a7bc223b1e9c88d818f24ba4d
refs/heads/master: 99aa36386351488d12ad5d302e096a77f22705d9
24 changes: 18 additions & 6 deletions trunk/drivers/acpi/processor_thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,13 @@ 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);
struct acpi_processor *pr;

if (!device || !pr)
if (!device)
return -EINVAL;

pr = acpi_driver_data(device);
if (!pr)
return -EINVAL;

*state = acpi_processor_max_state(pr);
Expand All @@ -232,9 +236,13 @@ 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);
struct acpi_processor *pr;

if (!device || !pr)
if (!device)
return -EINVAL;

pr = acpi_driver_data(device);
if (!pr)
return -EINVAL;

*cur_state = cpufreq_get_cur_state(pr->id);
Expand All @@ -248,11 +256,15 @@ 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);
struct acpi_processor *pr;
int result = 0;
int max_pstate;

if (!device || !pr)
if (!device)
return -EINVAL;

pr = acpi_driver_data(device);
if (!pr)
return -EINVAL;

max_pstate = cpufreq_get_max_state(pr->id);
Expand Down

0 comments on commit 68cdff1

Please sign in to comment.