public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* [patch 06/12] ACPI: report errors in fan.c
@ 2005-02-23  9:53 akpm-3NddpPZAyC0
       [not found] ` <200502230953.j1N9rIwN020705-bipKiLWnuIsyyg0EjBt7GtHuzzzSOjJt@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: akpm-3NddpPZAyC0 @ 2005-02-23  9:53 UTC (permalink / raw)
  To: len.brown-ral2JQCrhuEAvxtiuMwx3w
  Cc: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, akpm-3NddpPZAyC0,
	pavel-+ZI9xUNit7I


From: Pavel Machek <pavel-+ZI9xUNit7I@public.gmane.org>

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-3NddpPZAyC0@public.gmane.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	2005-02-23 01:48:03.000000000 -0800
+++ 25-akpm/drivers/acpi/fan.c	2005-02-23 01:48:03.000000000 -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);
 }
 
_


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [patch 06/12] ACPI: report errors in fan.c
       [not found] ` <200502230953.j1N9rIwN020705-bipKiLWnuIsyyg0EjBt7GtHuzzzSOjJt@public.gmane.org>
@ 2005-03-02 18:56   ` Len Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Len Brown @ 2005-03-02 18:56 UTC (permalink / raw)
  To: Andrew Morton; +Cc: ACPI Developers, pavel-+ZI9xUNit7I

Applied.

thanks,
-Len

On Wed, 2005-02-23 at 04:53, akpm-3NddpPZAyC0@public.gmane.org wrote:
> From: Pavel Machek <pavel-+ZI9xUNit7I@public.gmane.org>
> 
> 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-3NddpPZAyC0@public.gmane.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    2005-02-23
> 01:48:03.000000000 -0800
> +++ 25-akpm/drivers/acpi/fan.c  2005-02-23 01:48:03.000000000 -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);
>  }
> 
> _
> 
> 



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-03-02 18:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-23  9:53 [patch 06/12] ACPI: report errors in fan.c akpm-3NddpPZAyC0
     [not found] ` <200502230953.j1N9rIwN020705-bipKiLWnuIsyyg0EjBt7GtHuzzzSOjJt@public.gmane.org>
2005-03-02 18:56   ` Len Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox