Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/acpi Drop _HID requirement for attachment under acpi...



details:   https://anonhg.NetBSD.org/src/rev/2b28363fb6b5
branches:  trunk
changeset: 757902:2b28363fb6b5
user:      gsutre <gsutre%NetBSD.org@localhost>
date:      Sat Oct 02 18:06:47 2010 +0000

description:
Drop _HID requirement for attachment under acpi(4).  From now on,
drivers attaching to the acpinodebus interface should not assume
that the passed acpi_devnode has a valid _HID.

ok jruoho@

diffstat:

 sys/dev/acpi/acpi.c      |  13 ++-----------
 sys/dev/acpi/sony_acpi.c |   7 ++++---
 sys/dev/acpi/wss_acpi.c  |   7 +++++--
 sys/dev/acpi/ym_acpi.c   |   6 ++++--
 4 files changed, 15 insertions(+), 18 deletions(-)

diffs (117 lines):

diff -r bfb81b918b46 -r 2b28363fb6b5 sys/dev/acpi/acpi.c
--- a/sys/dev/acpi/acpi.c       Sat Oct 02 16:56:03 2010 +0000
+++ b/sys/dev/acpi/acpi.c       Sat Oct 02 18:06:47 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: acpi.c,v 1.219 2010/09/06 15:54:26 jmcneill Exp $      */
+/*     $NetBSD: acpi.c,v 1.220 2010/10/02 18:06:47 gsutre Exp $        */
 
 /*-
  * Copyright (c) 2003, 2007 The NetBSD Foundation, Inc.
@@ -100,7 +100,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.219 2010/09/06 15:54:26 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.220 2010/10/02 18:06:47 gsutre Exp $");
 
 #include "opt_acpi.h"
 #include "opt_pcifixup.h"
@@ -979,15 +979,6 @@
                }
 
                /*
-                * The same problem as above. As for example
-                * thermal zones and power resources do not
-                * have a valid HID, only evaluate devices.
-                */
-               if (di->Type == ACPI_TYPE_DEVICE &&
-                  (di->Valid & ACPI_VALID_HID) == 0)
-                       continue;
-
-               /*
                 * Handled internally.
                 */
                if (di->Type == ACPI_TYPE_POWER)
diff -r bfb81b918b46 -r 2b28363fb6b5 sys/dev/acpi/sony_acpi.c
--- a/sys/dev/acpi/sony_acpi.c  Sat Oct 02 16:56:03 2010 +0000
+++ b/sys/dev/acpi/sony_acpi.c  Sat Oct 02 18:06:47 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sony_acpi.c,v 1.19 2010/08/24 14:53:45 jruoho Exp $    */
+/*     $NetBSD: sony_acpi.c,v 1.20 2010/10/02 18:06:47 gsutre Exp $    */
 
 /*-
  * Copyright (c) 2005 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sony_acpi.c,v 1.19 2010/08/24 14:53:45 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sony_acpi.c,v 1.20 2010/10/02 18:06:47 gsutre Exp $");
 
 #include <sys/param.h>
 #include <sys/sysctl.h>
@@ -444,7 +444,8 @@
        if (ACPI_FAILURE(rv) || devinfo == NULL)
                return AE_OK;   /* we don't want to stop searching */
 
-       if (devinfo->HardwareId.String &&
+       if ((devinfo->Valid & ACPI_VALID_HID) != 0 &&
+           devinfo->HardwareId.String &&
            strncmp(devinfo->HardwareId.String, "SNY6001", 7) == 0)
                sc->sc_has_pic = true;
 
diff -r bfb81b918b46 -r 2b28363fb6b5 sys/dev/acpi/wss_acpi.c
--- a/sys/dev/acpi/wss_acpi.c   Sat Oct 02 16:56:03 2010 +0000
+++ b/sys/dev/acpi/wss_acpi.c   Sat Oct 02 18:06:47 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: wss_acpi.c,v 1.26 2010/03/05 14:00:17 jruoho Exp $ */
+/* $NetBSD: wss_acpi.c,v 1.27 2010/10/02 18:06:47 gsutre Exp $ */
 
 /*
  * Copyright (c) 2002 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wss_acpi.c,v 1.26 2010/03/05 14:00:17 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wss_acpi.c,v 1.27 2010/10/02 18:06:47 gsutre Exp $");
 
 #include <sys/param.h>
 #include <sys/audioio.h>
@@ -91,6 +91,9 @@
 {
        struct acpi_attach_args *aa = aux;
 
+       if ((aa->aa_node->ad_devinfo->Valid & ACPI_VALID_HID) == 0)
+               return 0;
+
        if (aa->aa_node->ad_type != ACPI_TYPE_DEVICE ||
            wss_acpi_hints_index(aa->aa_node->ad_devinfo->HardwareId.String) == -1)
                return 0;
diff -r bfb81b918b46 -r 2b28363fb6b5 sys/dev/acpi/ym_acpi.c
--- a/sys/dev/acpi/ym_acpi.c    Sat Oct 02 16:56:03 2010 +0000
+++ b/sys/dev/acpi/ym_acpi.c    Sat Oct 02 18:06:47 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ym_acpi.c,v 1.11 2010/03/05 14:00:17 jruoho Exp $ */
+/* $NetBSD: ym_acpi.c,v 1.12 2010/10/02 18:06:47 gsutre Exp $ */
 
 /*
  * Copyright (c) 2006 Jasper Wallace <jasper%pointless.net@localhost>
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ym_acpi.c,v 1.11 2010/03/05 14:00:17 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ym_acpi.c,v 1.12 2010/10/02 18:06:47 gsutre Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -62,6 +62,8 @@
 
        if (aa->aa_node->ad_type != ACPI_TYPE_DEVICE)
                return 0;
+       if (!(aa->aa_node->ad_devinfo->Valid & ACPI_VALID_HID))
+               return 0;
        if (!aa->aa_node->ad_devinfo->HardwareId.String)
                return 0;
        /* Yamaha OPL3-SA2 or OPL3-SA3 */



Home | Main Index | Thread Index | Old Index