summaryrefslogtreecommitdiff
path: root/drivers/acpi
diff options
context:
space:
mode:
authorZhang Rui <rui.zhang@intel.com>2008-04-29 02:36:07 -0400
committerAndi Kleen <andi@basil.nowhere.org>2008-07-16 23:27:01 +0200
commit9f1eb99c757939b0b1783f926130993e9c298bae (patch)
treea674f7ce31f6ac3caa3f27da0aa760331bc705a4 /drivers/acpi
parentb62b8ef906cdf7115af579ce7378886ce3e0ce00 (diff)
create sysfs link from acpi device to sysdev for cpu
Sys I/F under acpi device node and sysdev device node are both needed for cpu hot-removal. User space need this link so that they know they are poking the sys I/F for the same cpu. http://bugzilla.kernel.org/show_bug.cgi?id=9772 Signed-off-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Len Brown <len.brown@intel.com> Signed-off-by: Andi Kleen <ak@linux.intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/processor_core.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c
index 1c0008edccda..feddc8ed870a 100644
--- a/drivers/acpi/processor_core.c
+++ b/drivers/acpi/processor_core.c
@@ -621,7 +621,7 @@ static int __cpuinit acpi_processor_start(struct acpi_device *device)
int result = 0;
acpi_status status = AE_OK;
struct acpi_processor *pr;
-
+ struct sys_device *sysdev;
pr = acpi_driver_data(device);
@@ -652,6 +652,10 @@ static int __cpuinit acpi_processor_start(struct acpi_device *device)
if (result)
goto end;
+ sysdev = get_cpu_sysdev(pr->id);
+ if (sysfs_create_link(&device->dev.kobj, &sysdev->kobj, "sysdev"))
+ return -EFAULT;
+
status = acpi_install_notify_handler(pr->handle, ACPI_DEVICE_NOTIFY,
acpi_processor_notify, pr);
@@ -810,6 +814,8 @@ static int acpi_processor_remove(struct acpi_device *device, int type)
status = acpi_remove_notify_handler(pr->handle, ACPI_DEVICE_NOTIFY,
acpi_processor_notify);
+ sysfs_remove_link(&device->dev.kobj, "sysdev");
+
acpi_processor_remove_fs(device);
if (pr->cdev) {