* [PATCH] ACPI: Check whether cooling device exists before unregistering it
@ 2008-02-15 0:34 Zhao Yakui
2008-02-15 23:31 ` Len Brown
0 siblings, 1 reply; 2+ messages in thread
From: Zhao Yakui @ 2008-02-15 0:34 UTC (permalink / raw)
To: lenb; +Cc: linux-acpi
Subject: ACPI: Check whether cooling device exists before unregistering it
>From : Zhao Yakui <yakui.zhao@intel.com>
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>
---
drivers/acpi/processor_core.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
Index: linux-2.6/drivers/acpi/processor_core.c
===================================================================
--- linux-2.6.orig/drivers/acpi/processor_core.c
+++ linux-2.6/drivers/acpi/processor_core.c
@@ -809,10 +809,12 @@ static int acpi_processor_remove(struct
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;
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] ACPI: Check whether cooling device exists before unregistering it
2008-02-15 0:34 [PATCH] ACPI: Check whether cooling device exists before unregistering it Zhao Yakui
@ 2008-02-15 23:31 ` Len Brown
0 siblings, 0 replies; 2+ messages in thread
From: Len Brown @ 2008-02-15 23:31 UTC (permalink / raw)
To: Zhao Yakui; +Cc: linux-acpi
applied.
thanks,
-len
On Thursday 14 February 2008 19:34, Zhao Yakui wrote:
> Subject: ACPI: Check whether cooling device exists before unregistering it
> >From : Zhao Yakui <yakui.zhao@intel.com>
>
> 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>
>
> ---
> drivers/acpi/processor_core.c | 10 ++++++----
> 1 file changed, 6 insertions(+), 4 deletions(-)
>
> Index: linux-2.6/drivers/acpi/processor_core.c
> ===================================================================
> --- linux-2.6.orig/drivers/acpi/processor_core.c
> +++ linux-2.6/drivers/acpi/processor_core.c
> @@ -809,10 +809,12 @@ static int acpi_processor_remove(struct
>
> 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;
>
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-02-15 23:36 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-15 0:34 [PATCH] ACPI: Check whether cooling device exists before unregistering it Zhao Yakui
2008-02-15 23:31 ` Len Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox