diff options
author | Aaron Lu <aaron.lu@intel.com> | 2013-11-19 15:21:24 +0800 |
---|---|---|
committer | Zhang Rui <rui.zhang@intel.com> | 2014-10-10 13:57:11 +0800 |
commit | 8dd41f78adebb57909cccb0272e74c79e38b5238 (patch) | |
tree | 2689c5c2eaabc7ef048bb392e7b0246b3276603f | |
parent | bd6ad24342c3bc0476ba3f0b647c5ba0a71b45b4 (diff) | |
download | linux-8dd41f78adebb57909cccb0272e74c79e38b5238.tar.bz2 |
ACPI / fan: remove no need check for device pointer
The device pointer will not be NULL in the PM callback and ACPI driver's
add/remove callback, so checking NULL for them isn't necessary.
Signed-off-by: Aaron Lu <aaron.lu@intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
-rw-r--r-- | drivers/acpi/fan.c | 18 |
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) int result = 0; struct thermal_cooling_device *cdev; - if (!device) - return -EINVAL; - strcpy(acpi_device_name(device), "Fan"); strcpy(acpi_device_class(device), ACPI_FAN_CLASS); @@ -177,14 +174,7 @@ end: static int acpi_fan_remove(struct acpi_device *device) { - struct thermal_cooling_device *cdev; - - if (!device) - return -EINVAL; - - cdev = acpi_driver_data(device); - if (!cdev) - return -EINVAL; + struct thermal_cooling_device *cdev = acpi_driver_data(device); sysfs_remove_link(&device->dev.kobj, "thermal_cooling"); sysfs_remove_link(&cdev->device.kobj, "device"); @@ -196,9 +186,6 @@ static int acpi_fan_remove(struct acpi_device *device) #ifdef CONFIG_PM_SLEEP static int acpi_fan_suspend(struct device *dev) { - if (!dev) - return -EINVAL; - acpi_bus_set_power(to_acpi_device(dev)->handle, ACPI_STATE_D0); return AE_OK; @@ -208,9 +195,6 @@ static int acpi_fan_resume(struct device *dev) { int result; - if (!dev) - return -EINVAL; - result = acpi_bus_update_power(to_acpi_device(dev)->handle, NULL); if (result) printk(KERN_ERR PREFIX "Error updating fan power state\n"); |