Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/acpi Silently return if a power state transition is ...
details: https://anonhg.NetBSD.org/src/rev/fd67b0462320
branches: trunk
changeset: 755297:fd67b0462320
user: jruoho <jruoho%NetBSD.org@localhost>
date: Mon May 31 20:10:56 2010 +0000
description:
Silently return if a power state transition is requested for a device that
has no support for it. For example, in Kurt Schreiner's Shuttle G61:
Device (FAN)
{
Name (_HID, EisaId ("PNP0C0B"))
Method (_INI, 0, NotSerialized)
{
Store (TP1H, CTOS)
Store (TP1L, CTHY)
}
}
Obviously acpitz(4) has little use for a device that only contains _INI.
(The handle of this device is referenced incorrectly in _AL0.)
diffstat:
sys/dev/acpi/acpi_power.c | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
diffs (40 lines):
diff -r 0e8ddf2c5f96 -r fd67b0462320 sys/dev/acpi/acpi_power.c
--- a/sys/dev/acpi/acpi_power.c Mon May 31 19:40:21 2010 +0000
+++ b/sys/dev/acpi/acpi_power.c Mon May 31 20:10:56 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_power.c,v 1.12 2010/05/12 15:59:52 jruoho Exp $ */
+/* $NetBSD: acpi_power.c,v 1.13 2010/05/31 20:10:56 jruoho Exp $ */
/*-
* Copyright (c) 2009, 2010 The NetBSD Foundation, Inc.
@@ -56,7 +56,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_power.c,v 1.12 2010/05/12 15:59:52 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_power.c,v 1.13 2010/05/31 20:10:56 jruoho Exp $");
#include <sys/param.h>
#include <sys/kmem.h>
@@ -378,16 +378,16 @@
KASSERT(ad != NULL && ad->ad_root != NULL);
+ if ((ad->ad_flags & ACPI_DEVICE_POWER) == 0) {
+ ad->ad_state = ACPI_STATE_ERROR;
+ return false;
+ }
+
if (state < ACPI_STATE_D0 || state > ACPI_STATE_D3) {
rv = AE_BAD_PARAMETER;
goto fail;
}
- if ((ad->ad_flags & ACPI_DEVICE_POWER) == 0) {
- rv = AE_SUPPORT;
- goto fail;
- }
-
if (acpi_power_get(ad, &old) != true) {
rv = AE_NOT_FOUND;
goto fail;
Home |
Main Index |
Thread Index |
Old Index