|
@@ -174,9 +174,13 @@ static int acpi_fan_add(struct acpi_device *device)
|
|
|
|
|
|
static int acpi_fan_remove(struct acpi_device *device)
|
|
static int acpi_fan_remove(struct acpi_device *device)
|
|
{
|
|
{
|
|
- struct thermal_cooling_device *cdev = acpi_driver_data(device);
|
|
|
|
|
|
+ struct thermal_cooling_device *cdev;
|
|
|
|
+
|
|
|
|
+ if (!device)
|
|
|
|
+ return -EINVAL;
|
|
|
|
|
|
- if (!device || !cdev)
|
|
|
|
|
|
+ cdev = acpi_driver_data(device);
|
|
|
|
+ if (!cdev)
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
|
|
|
|
sysfs_remove_link(&device->dev.kobj, "thermal_cooling");
|
|
sysfs_remove_link(&device->dev.kobj, "thermal_cooling");
|