
From: Keiichiro Tokunaga <tokunaga.keiich@jp.fujitsu.com>

This fixes a if-statement in setup_sys_fs_device_files().  It seems to
assume that 'struct acpi_device_flags.ejectable' indicates whether a device
has _EJ0 or not.  But this is not a right assumption.  It indicates whether
a device has _EJ0|_EJD (See acpi_bus_get_flags() function).

setup_sys_fs_device_files() creates 'eject' file for devices that have _EJ0
control method under a corresponding directory in
/sys/firmware/acpi/namespace/ACPI/.  'eject' file is used to trigger
hot-removal function from userland.

Signed-off-by: Keiichiro Tokunaga <tokunaga.keiich@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/drivers/acpi/scan.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletion(-)

diff -puN drivers/acpi/scan.c~acpi-fix-a-if-statement-in-setup_sys_fs_device_files drivers/acpi/scan.c
--- 25/drivers/acpi/scan.c~acpi-fix-a-if-statement-in-setup_sys_fs_device_files	2005-02-22 21:04:45.000000000 -0800
+++ 25-akpm/drivers/acpi/scan.c	2005-02-22 21:04:45.000000000 -0800
@@ -358,7 +358,15 @@ setup_sys_fs_device_files (
 	struct acpi_device *dev,
 	acpi_device_sysfs_files *func)
 {
-	if (dev->flags.ejectable == 1)
+	acpi_status		status;
+	acpi_handle		temp = NULL;
+
+	/*
+	 * If device has _EJ0, 'eject' file is created that is used to trigger
+	 * hot-removal function from userland.
+	 */
+	status = acpi_get_handle(dev->handle, "_EJ0", &temp);
+	if (ACPI_SUCCESS(status))
 		(*(func))(&dev->kobj,&acpi_device_attr_eject.attr);
 }
 
_
