summaryrefslogtreecommitdiff
path: root/drivers/acpi/container.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-11-22 21:55:32 +0100
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-11-22 21:55:32 +0100
commit46394fd017c0615982a3d29d45ced14bea9c526d (patch)
tree403b87b00dfdb0368519ed4c52ae8f0428569310 /drivers/acpi/container.c
parent3338db0057ed9f554050bd06863731c515d79672 (diff)
ACPI / hotplug: Move container-specific code out of the core
Move container-specific uevents from the core hotplug code to the container scan handler's .attach() and .detach() callbacks. This way the core will not have to special-case containers and the uevents will be guaranteed to happen every time a container is either scanned or trimmed as appropriate. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Tested-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Diffstat (limited to 'drivers/acpi/container.c')
-rw-r--r--drivers/acpi/container.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/acpi/container.c b/drivers/acpi/container.c
index e23151667655..83d232c10f13 100644
--- a/drivers/acpi/container.c
+++ b/drivers/acpi/container.c
@@ -44,19 +44,24 @@ static const struct acpi_device_id container_device_ids[] = {
{"", 0},
};
-static int container_device_attach(struct acpi_device *device,
+static int container_device_attach(struct acpi_device *adev,
const struct acpi_device_id *not_used)
{
- /* This is necessary for container hotplug to work. */
+ kobject_uevent(&adev->dev.kobj, KOBJ_ONLINE);
return 1;
}
+static void container_device_detach(struct acpi_device *adev)
+{
+ kobject_uevent(&adev->dev.kobj, KOBJ_OFFLINE);
+}
+
static struct acpi_scan_handler container_handler = {
.ids = container_device_ids,
.attach = container_device_attach,
+ .detach = container_device_detach,
.hotplug = {
.enabled = true,
- .mode = AHM_CONTAINER,
},
};