@@ -41,6 +41,10 @@
#define _COMPONENT ACPI_CONTAINER_COMPONENT
ACPI_MODULE_NAME("container");
+static int container_device_attach(struct acpi_device *device,
+ const struct acpi_device_id *not_used);
+static void container_device_detach(struct acpi_device *device);
+
static const struct acpi_device_id container_device_ids[] = {
{"ACPI0004", 0},
{"PNP0A05", 0},
@@ -48,6 +52,12 @@ static const struct acpi_device_id container_device_ids[] = {
{"", 0},
};
+static struct acpi_scan_handler container_device_handler = {
+ .ids = container_device_ids,
+ .attach = container_device_attach,
+ .detach = container_device_detach,
+};
+
static int is_device_present(acpi_handle handle)
{
acpi_handle temp;
@@ -66,6 +76,17 @@ static int is_device_present(acpi_handle handle)
return ((sta & ACPI_STA_DEVICE_PRESENT) == ACPI_STA_DEVICE_PRESENT);
}
+static int container_device_attach(struct acpi_device *device,
+ const struct acpi_device_id *not_used)
+{
+ return 1;
+}
+
+static void container_device_detach(struct acpi_device *device)
+{
+ return;
+}
+
static void container_notify_cb(acpi_handle handle, u32 type, void *context)
{
struct acpi_device *device = NULL;
@@ -167,4 +188,6 @@ void __init acpi_container_init(void)
acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
acpi_container_register_notify_handler, NULL,
NULL, NULL);
+
+ acpi_scan_add_handler(&container_device_handler);
}
@@ -40,7 +40,7 @@ void acpi_memory_hotplug_init(void);
#else
static inline void acpi_memory_hotplug_init(void) {}
#endif
-#ifdef ACPI_CONTAINER
+#ifdef CONFIG_ACPI_CONTAINER
void acpi_container_init(void);
#else
static inline void acpi_container_init(void) {}
@@ -1,12 +1,4 @@
#ifndef __ACPI_CONTAINER_H
#define __ACPI_CONTAINER_H
-#include <linux/kernel.h>
-
-struct acpi_container {
- acpi_handle handle;
- unsigned long sun;
- int state;
-};
-
#endif /* __ACPI_CONTAINER_H */
Changed to register the ACPI container driver as an ACPI scan driver so that sysfs eject of container devices works. Fixed a typo in the acpi_container_init() prototype definition. Removed struct acpi_container, which is no longer used. Signed-off-by: Toshi Kani <toshi.kani@hp.com> --- This patch applies on top of the patch below. https://lkml.org/lkml/2013/2/3/318 --- drivers/acpi/container.c | 23 +++++++++++++++++++++++ drivers/acpi/internal.h | 2 +- include/acpi/container.h | 8 -------- 3 files changed, 24 insertions(+), 9 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html