ChangeSet 1.1938.505.20, 2005/03/02 14:13:39-05:00, [EMAIL PROTECTED]

        [ACPI] fix sysfs "eject" file
        
        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.
        
        <Note that we expect this file location to change in the future.>
        
        Signed-off-by: Keiichiro Tokunaga <[EMAIL PROTECTED]>
        Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
        Signed-off-by: Len Brown <[EMAIL PROTECTED]>



 scan.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletion(-)


diff -Nru a/drivers/acpi/scan.c b/drivers/acpi/scan.c
--- a/drivers/acpi/scan.c       2005-04-01 08:11:19 -08:00
+++ b/drivers/acpi/scan.c       2005-04-01 08:11:19 -08:00
@@ -383,7 +383,15 @@
        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);
 }
 
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to