ChangeSet 1.1938.505.16, 2005/03/02 13:54:47-05:00, [EMAIL PROTECTED]

        [ACPI] enhance fan output in error path
        
        Currently, fan.c ignores errors from acpi_bus_get_power.  On compaq evo
        notebook that leads to very confusing empty output.
        
        From: Pavel Machek <[EMAIL PROTECTED]>
        Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
        Signed-off-by: Len Brown <[EMAIL PROTECTED]>



 fan.c |   19 ++++++++-----------
 1 files changed, 8 insertions(+), 11 deletions(-)


diff -Nru a/drivers/acpi/fan.c b/drivers/acpi/fan.c
--- a/drivers/acpi/fan.c        2005-04-01 08:10:24 -08:00
+++ b/drivers/acpi/fan.c        2005-04-01 08:10:24 -08:00
@@ -78,21 +78,18 @@
 static int
 acpi_fan_read_state (struct seq_file *seq, void *offset)
 {
-       struct acpi_fan         *fan = (struct acpi_fan *) seq->private;
+       struct acpi_fan         *fan = seq->private;
        int                     state = 0;
 
        ACPI_FUNCTION_TRACE("acpi_fan_read_state");
 
-       if (!fan)
-               goto end;
-
-       if (acpi_bus_get_power(fan->handle, &state))
-               goto end;
-
-       seq_printf(seq, "status:                  %s\n",
-               !state?"on":"off");
-
-end:
+       if (fan) {
+               if (acpi_bus_get_power(fan->handle, &state))
+                       seq_printf(seq, "status:                  ERROR\n");
+               else
+                       seq_printf(seq, "status:                  %s\n",
+                                    !state?"on":"off");
+       }
        return_VALUE(0);
 }
 
-
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