
From: Pavel Machek <pavel@ucw.cz>

Currently, fan.c ignores errors from acpi_bus_get_power.  On compaq evo
notebook that leads to very confusing empty output.

Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/drivers/acpi/fan.c |   19 ++++++++-----------
 1 files changed, 8 insertions(+), 11 deletions(-)

diff -puN drivers/acpi/fan.c~acpi-report-errors-in-fanc drivers/acpi/fan.c
--- 25/drivers/acpi/fan.c~acpi-report-errors-in-fanc	2004-11-11 15:57:51.271686728 -0800
+++ 25-akpm/drivers/acpi/fan.c	2004-11-11 16:00:23.638523448 -0800
@@ -78,21 +78,18 @@ struct proc_dir_entry		*acpi_fan_dir;
 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);
 }
 
_
