aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/acpi/fan.c18
1 files changed, 1 insertions, 17 deletions
diff --git a/drivers/acpi/fan.c b/drivers/acpi/fan.c
index 562d5f3a1bb5..df861bbc73cc 100644
--- a/drivers/acpi/fan.c
+++ b/drivers/acpi/fan.c
@@ -131,9 +131,6 @@ static int acpi_fan_add(struct acpi_device *device)
131 int result = 0; 131 int result = 0;
132 struct thermal_cooling_device *cdev; 132 struct thermal_cooling_device *cdev;
133 133
134 if (!device)
135 return -EINVAL;
136
137 strcpy(acpi_device_name(device), "Fan"); 134 strcpy(acpi_device_name(device), "Fan");
138 strcpy(acpi_device_class(device), ACPI_FAN_CLASS); 135 strcpy(acpi_device_class(device), ACPI_FAN_CLASS);
139 136
@@ -177,14 +174,7 @@ end:
177 174
178static int acpi_fan_remove(struct acpi_device *device) 175static int acpi_fan_remove(struct acpi_device *device)
179{ 176{
180 struct thermal_cooling_device *cdev; 177 struct thermal_cooling_device *cdev = acpi_driver_data(device);
181
182 if (!device)
183 return -EINVAL;
184
185 cdev = acpi_driver_data(device);
186 if (!cdev)
187 return -EINVAL;
188 178
189 sysfs_remove_link(&device->dev.kobj, "thermal_cooling"); 179 sysfs_remove_link(&device->dev.kobj, "thermal_cooling");
190 sysfs_remove_link(&cdev->device.kobj, "device"); 180 sysfs_remove_link(&cdev->device.kobj, "device");
@@ -196,9 +186,6 @@ static int acpi_fan_remove(struct acpi_device *device)
196#ifdef CONFIG_PM_SLEEP 186#ifdef CONFIG_PM_SLEEP
197static int acpi_fan_suspend(struct device *dev) 187static int acpi_fan_suspend(struct device *dev)
198{ 188{
199 if (!dev)
200 return -EINVAL;
201
202 acpi_bus_set_power(to_acpi_device(dev)->handle, ACPI_STATE_D0); 189 acpi_bus_set_power(to_acpi_device(dev)->handle, ACPI_STATE_D0);
203 190
204 return AE_OK; 191 return AE_OK;
@@ -208,9 +195,6 @@ static int acpi_fan_resume(struct device *dev)
208{ 195{
209 int result; 196 int result;
210 197
211 if (!dev)
212 return -EINVAL;
213
214 result = acpi_bus_update_power(to_acpi_device(dev)->handle, NULL); 198 result = acpi_bus_update_power(to_acpi_device(dev)->handle, NULL);
215 if (result) 199 if (result)
216 printk(KERN_ERR PREFIX "Error updating fan power state\n"); 200 printk(KERN_ERR PREFIX "Error updating fan power state\n");