Module Name: src Committed By: gsutre Date: Sat Oct 2 18:06:47 UTC 2010
Modified Files: src/sys/dev/acpi: acpi.c sony_acpi.c wss_acpi.c ym_acpi.c Log Message: 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@ To generate a diff of this commit: cvs rdiff -u -r1.219 -r1.220 src/sys/dev/acpi/acpi.c cvs rdiff -u -r1.19 -r1.20 src/sys/dev/acpi/sony_acpi.c cvs rdiff -u -r1.26 -r1.27 src/sys/dev/acpi/wss_acpi.c cvs rdiff -u -r1.11 -r1.12 src/sys/dev/acpi/ym_acpi.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/acpi/acpi.c diff -u src/sys/dev/acpi/acpi.c:1.219 src/sys/dev/acpi/acpi.c:1.220 --- src/sys/dev/acpi/acpi.c:1.219 Mon Sep 6 15:54:26 2010 +++ src/sys/dev/acpi/acpi.c Sat Oct 2 18:06:47 2010 @@ -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) Index: src/sys/dev/acpi/sony_acpi.c diff -u src/sys/dev/acpi/sony_acpi.c:1.19 src/sys/dev/acpi/sony_acpi.c:1.20 --- src/sys/dev/acpi/sony_acpi.c:1.19 Tue Aug 24 14:53:45 2010 +++ src/sys/dev/acpi/sony_acpi.c Sat Oct 2 18:06:47 2010 @@ -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; Index: src/sys/dev/acpi/wss_acpi.c diff -u src/sys/dev/acpi/wss_acpi.c:1.26 src/sys/dev/acpi/wss_acpi.c:1.27 --- src/sys/dev/acpi/wss_acpi.c:1.26 Fri Mar 5 14:00:17 2010 +++ src/sys/dev/acpi/wss_acpi.c Sat Oct 2 18:06:47 2010 @@ -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 <jmcne...@invisible.ca> @@ -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; Index: src/sys/dev/acpi/ym_acpi.c diff -u src/sys/dev/acpi/ym_acpi.c:1.11 src/sys/dev/acpi/ym_acpi.c:1.12 --- src/sys/dev/acpi/ym_acpi.c:1.11 Fri Mar 5 14:00:17 2010 +++ src/sys/dev/acpi/ym_acpi.c Sat Oct 2 18:06:47 2010 @@ -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 <jas...@pointless.net> @@ -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 */