[PATCH 02/02] ACPI: Register container drv as scan driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxx>
---

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(-)

diff --git a/drivers/acpi/container.c b/drivers/acpi/container.c
index bcde1f3..f493180 100644
--- a/drivers/acpi/container.c
+++ b/drivers/acpi/container.c
@@ -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);
 }
diff --git a/drivers/acpi/internal.h b/drivers/acpi/internal.h
index 78fbf26..cbc0638 100644
--- a/drivers/acpi/internal.h
+++ b/drivers/acpi/internal.h
@@ -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) {}
diff --git a/include/acpi/container.h b/include/acpi/container.h
index a703f14..0a464d2 100644
--- a/include/acpi/container.h
+++ b/include/acpi/container.h
@@ -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 */
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux