Subject: [PATCH] [acpi driver model] Enable per-device attribute creation - Call acpi_device_sysfs_add() when device is bound and call acpi_device_sysfs_remove() when device is unbound from a driver. Signed-off-by: Patrick Mochel --- drivers/acpi/drivers/core/driver.c | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-) applies-to: c2b08ad066854f94b75bda35fdcd8a9c0a53cb78 ddbce0f39a29da7885f78bc53da9f060897a694d diff --git a/drivers/acpi/drivers/core/driver.c b/drivers/acpi/drivers/core/driver.c index 55a5bb7..4dac1d3 100644 --- a/drivers/acpi/drivers/core/driver.c +++ b/drivers/acpi/drivers/core/driver.c @@ -17,6 +17,7 @@ #include "core.h" #include "event.h" #include "proc.h" +#include "sysfs.h" /** * acpi_device_start - Fire up an ACPI device. @@ -116,11 +117,21 @@ static int acpi_device_add(struct device if (ret) goto RemoveEvent; + /* + * Add the per-device sysfs interface + */ + ret = acpi_device_sysfs_add(ad); + if (ret) + goto RemoveProc; + Done: dbg("Probing Done: Device [%s] Driver [%s], Return [%d]", ad->dev.bus_id, adrv->d_drv.name, ret); return ret; + RemoveProc: + acpi_device_proc_remove(ad); + RemoveEvent: acpi_device_event_remove(ad); @@ -149,6 +160,11 @@ static int acpi_device_remove(struct dev ad->dev.bus_id, adrv->d_drv.name); /* + * Remove the sysfs interface + */ + acpi_device_sysfs_remove(ad); + + /* * Remove the proc interface */ acpi_device_proc_remove(ad); --- 0.99.9.GIT