diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-11-22 15:55:32 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-11-22 15:55:32 -0500 |
commit | 46394fd017c0615982a3d29d45ced14bea9c526d (patch) | |
tree | 403b87b00dfdb0368519ed4c52ae8f0428569310 /drivers/acpi/container.c | |
parent | 3338db0057ed9f554050bd06863731c515d79672 (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.c | 11 |
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[] = { | |||
44 | {"", 0}, | 44 | {"", 0}, |
45 | }; | 45 | }; |
46 | 46 | ||
47 | static int container_device_attach(struct acpi_device *device, | 47 | static int container_device_attach(struct acpi_device *adev, |
48 | const struct acpi_device_id *not_used) | 48 | const struct acpi_device_id *not_used) |
49 | { | 49 | { |
50 | /* This is necessary for container hotplug to work. */ | 50 | kobject_uevent(&adev->dev.kobj, KOBJ_ONLINE); |
51 | return 1; | 51 | return 1; |
52 | } | 52 | } |
53 | 53 | ||
54 | static void container_device_detach(struct acpi_device *adev) | ||
55 | { | ||
56 | kobject_uevent(&adev->dev.kobj, KOBJ_OFFLINE); | ||
57 | } | ||
58 | |||
54 | static struct acpi_scan_handler container_handler = { | 59 | static struct acpi_scan_handler container_handler = { |
55 | .ids = container_device_ids, | 60 | .ids = container_device_ids, |
56 | .attach = container_device_attach, | 61 | .attach = container_device_attach, |
62 | .detach = container_device_detach, | ||
57 | .hotplug = { | 63 | .hotplug = { |
58 | .enabled = true, | 64 | .enabled = true, |
59 | .mode = AHM_CONTAINER, | ||
60 | }, | 65 | }, |
61 | }; | 66 | }; |
62 | 67 | ||