Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/acpi Fix a minor bug where a reference handle is use...
details: https://anonhg.NetBSD.org/src/rev/ecd657711e98
branches: trunk
changeset: 750902:ecd657711e98
user: jruoho <jruoho%NetBSD.org@localhost>
date: Mon Jan 18 17:09:17 2010 +0000
description:
Fix a minor bug where a reference handle is used for error reporting even
though it may not be present. While here, convert few lines to aprint_*().
ok pgoyette@
diffstat:
sys/dev/acpi/acpi_tz.c | 22 +++++++++-------------
1 files changed, 9 insertions(+), 13 deletions(-)
diffs (51 lines):
diff -r 0e1f87e04f49 -r ecd657711e98 sys/dev/acpi/acpi_tz.c
--- a/sys/dev/acpi/acpi_tz.c Mon Jan 18 16:57:39 2010 +0000
+++ b/sys/dev/acpi/acpi_tz.c Mon Jan 18 17:09:17 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_tz.c,v 1.54 2010/01/05 13:47:52 jruoho Exp $ */
+/* $NetBSD: acpi_tz.c,v 1.55 2010/01/18 17:09:17 jruoho Exp $ */
/*
* Copyright (c) 2003 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_tz.c,v 1.54 2010/01/05 13:47:52 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_tz.c,v 1.55 2010/01/18 17:09:17 jruoho Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -401,25 +401,21 @@
case ACPI_TYPE_STRING:
rv = AcpiGetHandle(NULL, obj->String.Pointer, &cooler);
if (ACPI_FAILURE(rv)) {
- printf("acpitz_switch_cooler: "
- "failed to get handler from %s\n",
- obj->String.Pointer);
+ aprint_error("%s: failed to get handler from %s\n",
+ __func__, obj->String.Pointer);
return rv;
}
break;
default:
- printf("acpitz_switch_cooler: "
- "unknown power type: %d\n", obj->Type);
+ aprint_error("%s: unknown power type: %u\n",
+ __func__, obj->Type);
return AE_OK;
}
rv = acpi_pwr_switch_consumer(cooler, pwr_state);
- if (rv != AE_BAD_PARAMETER && ACPI_FAILURE(rv)) {
- printf("acpitz_switch_cooler: "
- "failed to change state for %s: %s\n",
- acpi_name(obj->Reference.Handle),
- AcpiFormatException(rv));
- }
+ if (rv != AE_BAD_PARAMETER && ACPI_FAILURE(rv))
+ aprint_error("%s: failed to change state for %s: %s\n",
+ __func__, acpi_name(cooler), AcpiFormatException(rv));
return AE_OK;
}
Home |
Main Index |
Thread Index |
Old Index