Skip to content

Commit

Permalink
ACPI: thermal: Check whether cooling device exists before unregistering
Browse files Browse the repository at this point in the history
OS should check whether the cooling device exists before it is unregistered.
If it doesn't exists, it is unnecessary to remove the sysfs link
and call the function of thermal_cooling_device_unregister.

http://bugzilla.kernel.org/show_bug.cgi?id=9982

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Tested-by    : Dhaval Giani <dhaval@linux.vnet.ibm.com>
Signed-off-by: Len Brown <len.brown@intel.com>
  • Loading branch information
Zhao Yakui authored and Len Brown committed Feb 15, 2008
1 parent 101142c commit f28bb45
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions drivers/acpi/processor_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -809,10 +809,12 @@ static int acpi_processor_remove(struct acpi_device *device, int type)

acpi_processor_remove_fs(device);

sysfs_remove_link(&device->dev.kobj, "thermal_cooling");
sysfs_remove_link(&pr->cdev->device.kobj, "device");
thermal_cooling_device_unregister(pr->cdev);
pr->cdev = NULL;
if (pr->cdev) {
sysfs_remove_link(&device->dev.kobj, "thermal_cooling");
sysfs_remove_link(&pr->cdev->device.kobj, "device");
thermal_cooling_device_unregister(pr->cdev);
pr->cdev = NULL;
}

processors[pr->id] = NULL;

Expand Down

0 comments on commit f28bb45

Please sign in to comment.