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 bug: the last elements in the _PRW packag...



details:   https://anonhg.NetBSD.org/src/rev/38684ad7b21c
branches:  trunk
changeset: 755492:38684ad7b21c
user:      jruoho <jruoho%NetBSD.org@localhost>
date:      Mon Jun 07 14:12:20 2010 +0000

description:
Fix a bug: the last elements in the _PRW package are direct references to
power resources, not devices. Thus, we can not use the function that sets
the power state of a device.

diffstat:

 sys/dev/acpi/acpi_wakedev.c |  12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diffs (53 lines):

diff -r 2ef9b756f4dd -r 38684ad7b21c sys/dev/acpi/acpi_wakedev.c
--- a/sys/dev/acpi/acpi_wakedev.c       Mon Jun 07 14:07:25 2010 +0000
+++ b/sys/dev/acpi/acpi_wakedev.c       Mon Jun 07 14:12:20 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_wakedev.c,v 1.16 2010/06/07 04:08:26 jruoho Exp $ */
+/* $NetBSD: acpi_wakedev.c,v 1.17 2010/06/07 14:12:20 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2009, 2010 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_wakedev.c,v 1.16 2010/06/07 04:08:26 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_wakedev.c,v 1.17 2010/06/07 14:12:20 jruoho Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -54,7 +54,7 @@
 
 static void    acpi_wakedev_method(struct acpi_devnode *, int, int);
 static void    acpi_wakedev_gpe(struct acpi_devnode *, int, int);
-static void    acpi_wakedev_power(ACPI_OBJECT *);
+static void    acpi_wakedev_power(struct acpi_devnode *, ACPI_OBJECT *);
 
 SYSCTL_SETUP(sysctl_acpi_wakedev_setup, "sysctl hw.acpi.wake subtree setup")
 {
@@ -266,7 +266,7 @@
         * Turn on power resources.
         */
        if (enable != 0)
-               acpi_wakedev_power(obj);
+               acpi_wakedev_power(ad, obj);
 
        /*
         * Set both runtime and wake GPEs, but unset only wake GPEs.
@@ -284,7 +284,7 @@
 }
 
 static void
-acpi_wakedev_power(ACPI_OBJECT *obj)
+acpi_wakedev_power(struct acpi_devnode *ad, ACPI_OBJECT *obj)
 {
        ACPI_OBJECT *elm;
        ACPI_HANDLE hdl;
@@ -304,6 +304,6 @@
                if (ACPI_FAILURE(rv))
                        continue;
 
-               (void)acpi_power_set_from_handle(hdl, ACPI_STATE_D0);
+               (void)acpi_power_res(hdl, ad->ad_handle, true);
        }
 }



Home | Main Index | Thread Index | Old Index