ACPI: convert to sysfs framework
Subsystems (2)
PATCH 7/14 ACPI: convert to sysfs framework
From: Patrick Mochel <[email protected]>
Setup new sysfs framework
1. Remove /sys/firmware/acpi
2. Add ACPI device in device tree.
File "eject" for every device that has _EJ0 method is moved from /sys/firmware to /sys/devices.
Operation on this file is exactly the same as before. i.e. echo 1 to "eject" will cause hot removal of this device. Corresponding changes should be made in userspace for hot removal.
Signed-off-by Li Shaohua <[email protected]>
Signed-off-by Zhang Rui<[email protected]>
Signed-off-by Len Brown <[email protected]>
--- drivers/acpi/bus.c | 2 +- drivers/acpi/container.c | 6 +- drivers/acpi/processor_core.c | 8 +- drivers/acpi/scan.c | 187 +++++++++-------------------------------- include/acpi/acpi_bus.h | 1 - 5 files changed, 49 insertions(+), 155 deletions(-)
drivers/acpi/bus.c +1 -1
@@ -195,7 +195,7 @@ int acpi_bus_set_power(acpi_handle handlif (!device->flags.power_manageable) {ACPI_DEBUG_PRINT ((ACPI_DB_INFO ,"Device `[%s]' is not power manageable\n" , - device->kobj.name)); + device->dev.kobj.name));return -ENODEV ; }/*
drivers/acpi/container.c +3 -3
@@ -168,7 +168,7 @@ static void container_notify_cb(acpi_hanif (ACPI_FAILURE (status) || !device) { result =container_device_add (&device, handle);if (!result) -kobject_uevent (&device->kobj, +kobject_uevent (&device->dev.kobj,KOBJ_ONLINE );else printk ("Failed to add container\n" );
@@ -176,13 +176,13 @@ static void container_notify_cb(acpi_han }else {if (ACPI_SUCCESS (status)) {/* device exist and this is a remove request */ -kobject_uevent (&device->kobj,KOBJ_OFFLINE ); +kobject_uevent (&device->dev.kobj,KOBJ_OFFLINE ); } }break ;case ACPI_NOTIFY_EJECT_REQUEST :if (!acpi_bus_get_device (handle, &device) && device) { -kobject_uevent (&device->kobj,KOBJ_OFFLINE ); +kobject_uevent (&device->dev.kobj,KOBJ_OFFLINE ); }break ;default :
drivers/acpi/processor_core.c +4 -4
@@ -711,7 +711,7 @@ int acpi_processor_device_add(acpi_handlreturn -ENODEV ;if ((pr->id >=0 ) && (pr->id <NR_CPUS )) { -kobject_uevent (&(*device)->kobj,KOBJ_ONLINE ); +kobject_uevent (&(*device)->dev.kobj,KOBJ_ONLINE ); }return 0 ; }
@@ -749,13 +749,13 @@ acpi_processor_hotplug_notify(acpi_handl }if (pr->id >=0 && (pr->id <NR_CPUS )) { -kobject_uevent (&device->kobj,KOBJ_OFFLINE ); +kobject_uevent (&device->dev.kobj,KOBJ_OFFLINE );break ; } result =acpi_processor_start (device);if ((!result) && ((pr->id >=0 ) && (pr->id <NR_CPUS ))) { -kobject_uevent (&device->kobj,KOBJ_ONLINE ); +kobject_uevent (&device->dev.kobj,KOBJ_ONLINE ); }else { printk(KERN_ERR PREFIX "Device [%s] failed to start\n", acpi_device_bid(device));
@@ -778,7 +778,7 @@ acpi_processor_hotplug_notify(acpi_handl }if ((pr->id <NR_CPUS ) && (cpu_present (pr->id))) -kobject_uevent (&device->kobj,KOBJ_OFFLINE ); +kobject_uevent (&device->dev.kobj,KOBJ_OFFLINE );break ;default : ACPI_DEBUG_PRINT((ACPI_DB_INFO,
drivers/acpi/scan.c +41 -146
256 lines not on this page · raw message
include/acpi/acpi_bus.h +0 -1
@@ -299,7 +299,6 @@ struct acpi_device {struct acpi_device_ops ops;struct acpi_driver *driver;void *driver_data; -struct kobject kobj;struct device dev; };
Signature · 1 line
1.4.4.g59427