diff options
author | Aaron Lu <aaron.lu@intel.com> | 2013-11-19 02:43:52 -0500 |
---|---|---|
committer | Zhang Rui <rui.zhang@intel.com> | 2014-10-10 01:57:12 -0400 |
commit | 2bb3a2bf9939f3361e25045f4ef7b136b864c3b8 (patch) | |
tree | d4132de91d6589e9c641e52023f90fceee8b8cb6 /drivers/acpi/fan.c | |
parent | 8dd41f78adebb57909cccb0272e74c79e38b5238 (diff) |
ACPI / fan: use acpi_device_xxx_power instead of acpi_bus equivelant
When we have the acpi_device pointer, there is no need to pass the
device's handle to the acpi_bus_xxx_power functions to get/set/update
the device's power state, instead, use the acpi_device_xxx_power
functions directly.
To make this happen for fan module, export acpi_device_update_power.
Signed-off-by: Aaron Lu <aaron.lu@intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Diffstat (limited to 'drivers/acpi/fan.c')
-rw-r--r-- | drivers/acpi/fan.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/acpi/fan.c b/drivers/acpi/fan.c index df861bbc73cc..fff9696bea25 100644 --- a/drivers/acpi/fan.c +++ b/drivers/acpi/fan.c | |||
@@ -92,7 +92,7 @@ static int fan_get_cur_state(struct thermal_cooling_device *cdev, unsigned long | |||
92 | if (!device) | 92 | if (!device) |
93 | return -EINVAL; | 93 | return -EINVAL; |
94 | 94 | ||
95 | result = acpi_bus_update_power(device->handle, &acpi_state); | 95 | result = acpi_device_update_power(device, &acpi_state); |
96 | if (result) | 96 | if (result) |
97 | return result; | 97 | return result; |
98 | 98 | ||
@@ -110,7 +110,7 @@ fan_set_cur_state(struct thermal_cooling_device *cdev, unsigned long state) | |||
110 | if (!device || (state != 0 && state != 1)) | 110 | if (!device || (state != 0 && state != 1)) |
111 | return -EINVAL; | 111 | return -EINVAL; |
112 | 112 | ||
113 | result = acpi_bus_set_power(device->handle, | 113 | result = acpi_device_set_power(device, |
114 | state ? ACPI_STATE_D0 : ACPI_STATE_D3_COLD); | 114 | state ? ACPI_STATE_D0 : ACPI_STATE_D3_COLD); |
115 | 115 | ||
116 | return result; | 116 | return result; |
@@ -134,7 +134,7 @@ static int acpi_fan_add(struct acpi_device *device) | |||
134 | strcpy(acpi_device_name(device), "Fan"); | 134 | strcpy(acpi_device_name(device), "Fan"); |
135 | strcpy(acpi_device_class(device), ACPI_FAN_CLASS); | 135 | strcpy(acpi_device_class(device), ACPI_FAN_CLASS); |
136 | 136 | ||
137 | result = acpi_bus_update_power(device->handle, NULL); | 137 | result = acpi_device_update_power(device, NULL); |
138 | if (result) { | 138 | if (result) { |
139 | printk(KERN_ERR PREFIX "Setting initial power state\n"); | 139 | printk(KERN_ERR PREFIX "Setting initial power state\n"); |
140 | goto end; | 140 | goto end; |
@@ -186,7 +186,7 @@ static int acpi_fan_remove(struct acpi_device *device) | |||
186 | #ifdef CONFIG_PM_SLEEP | 186 | #ifdef CONFIG_PM_SLEEP |
187 | static int acpi_fan_suspend(struct device *dev) | 187 | static int acpi_fan_suspend(struct device *dev) |
188 | { | 188 | { |
189 | acpi_bus_set_power(to_acpi_device(dev)->handle, ACPI_STATE_D0); | 189 | acpi_device_set_power(to_acpi_device(dev), ACPI_STATE_D0); |
190 | 190 | ||
191 | return AE_OK; | 191 | return AE_OK; |
192 | } | 192 | } |
@@ -195,7 +195,7 @@ static int acpi_fan_resume(struct device *dev) | |||
195 | { | 195 | { |
196 | int result; | 196 | int result; |
197 | 197 | ||
198 | result = acpi_bus_update_power(to_acpi_device(dev)->handle, NULL); | 198 | result = acpi_device_update_power(to_acpi_device(dev), NULL); |
199 | if (result) | 199 | if (result) |
200 | printk(KERN_ERR PREFIX "Error updating fan power state\n"); | 200 | printk(KERN_ERR PREFIX "Error updating fan power state\n"); |
201 | 201 | ||