Module Name: src Committed By: thorpej Date: Wed Mar 24 14:21:08 UTC 2021
Modified Files: src/sys/arch/arm/broadcom [thorpej-cfargs]: bcm2835_vcaudio.c src/sys/arch/arm/omap [thorpej-cfargs]: tiotg.c src/sys/arch/x86/pci [thorpej-cfargs]: pcib.c src/sys/dev/acpi/wmi [thorpej-cfargs]: wmi_acpi.c src/sys/dev/hdaudio [thorpej-cfargs]: hdaudio.c src/sys/dev/pci [thorpej-cfargs]: ichsmb.c ismt.c piixpm.c Log Message: Don't filter interface attributes in rescan functions for devices that carry only a single interface attribute. The autoconfiguration machinery already considers interface attributes when searching for possible parents. To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.17.2.1 src/sys/arch/arm/broadcom/bcm2835_vcaudio.c cvs rdiff -u -r1.7.18.1 -r1.7.18.2 src/sys/arch/arm/omap/tiotg.c cvs rdiff -u -r1.19 -r1.19.10.1 src/sys/arch/x86/pci/pcib.c cvs rdiff -u -r1.17 -r1.17.2.1 src/sys/dev/acpi/wmi/wmi_acpi.c cvs rdiff -u -r1.13.2.2 -r1.13.2.3 src/sys/dev/hdaudio/hdaudio.c cvs rdiff -u -r1.69 -r1.69.2.1 src/sys/dev/pci/ichsmb.c cvs rdiff -u -r1.7 -r1.7.10.1 src/sys/dev/pci/ismt.c cvs rdiff -u -r1.63 -r1.63.8.1 src/sys/dev/pci/piixpm.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/arch/arm/broadcom/bcm2835_vcaudio.c diff -u src/sys/arch/arm/broadcom/bcm2835_vcaudio.c:1.17 src/sys/arch/arm/broadcom/bcm2835_vcaudio.c:1.17.2.1 --- src/sys/arch/arm/broadcom/bcm2835_vcaudio.c:1.17 Wed Jan 27 12:06:10 2021 +++ src/sys/arch/arm/broadcom/bcm2835_vcaudio.c Wed Mar 24 14:21:08 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: bcm2835_vcaudio.c,v 1.17 2021/01/27 12:06:10 nia Exp $ */ +/* $NetBSD: bcm2835_vcaudio.c,v 1.17.2.1 2021/03/24 14:21:08 thorpej Exp $ */ /*- * Copyright (c) 2013 Jared D. McNeill <jmcne...@invisible.ca> @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: bcm2835_vcaudio.c,v 1.17 2021/01/27 12:06:10 nia Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bcm2835_vcaudio.c,v 1.17.2.1 2021/03/24 14:21:08 thorpej Exp $"); #include <sys/param.h> #include <sys/types.h> @@ -237,7 +237,7 @@ vcaudio_rescan(device_t self, const char struct vcaudio_softc *sc = device_private(self); int error; - if (ifattr_match(ifattr, "audiobus") && sc->sc_audiodev == NULL) { + if (sc->sc_audiodev == NULL) { error = vcaudio_init(sc); if (error) { return error; Index: src/sys/arch/arm/omap/tiotg.c diff -u src/sys/arch/arm/omap/tiotg.c:1.7.18.1 src/sys/arch/arm/omap/tiotg.c:1.7.18.2 --- src/sys/arch/arm/omap/tiotg.c:1.7.18.1 Tue Mar 23 07:14:44 2021 +++ src/sys/arch/arm/omap/tiotg.c Wed Mar 24 14:21:08 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: tiotg.c,v 1.7.18.1 2021/03/23 07:14:44 thorpej Exp $ */ +/* $NetBSD: tiotg.c,v 1.7.18.2 2021/03/24 14:21:08 thorpej Exp $ */ /* * Copyright (c) 2013 Manuel Bouyer. All rights reserved. * @@ -24,7 +24,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: tiotg.c,v 1.7.18.1 2021/03/23 07:14:44 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tiotg.c,v 1.7.18.2 2021/03/24 14:21:08 thorpej Exp $"); #include "opt_omap.h" #include "locators.h" @@ -196,8 +196,6 @@ tiotg_rescan(device_t self, const char * for (i = 0; i < TI_OTG_NPORTS; i++) { if (sc->sc_motgdev[i] != NULL) continue; - if (!ifattr_match(ifattr, "tiotg_port")) - continue; if (bus_space_subregion(sc->sc_iot, sc->sc_ioh, USB_CTRL_OFFSET(i), USB_PORT_SIZE, &aa.aa_ioh) < 0) { aprint_error_dev(self, Index: src/sys/arch/x86/pci/pcib.c diff -u src/sys/arch/x86/pci/pcib.c:1.19 src/sys/arch/x86/pci/pcib.c:1.19.10.1 --- src/sys/arch/x86/pci/pcib.c:1.19 Fri Oct 4 12:23:37 2019 +++ src/sys/arch/x86/pci/pcib.c Wed Mar 24 14:21:08 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: pcib.c,v 1.19 2019/10/04 12:23:37 mrg Exp $ */ +/* $NetBSD: pcib.c,v 1.19.10.1 2021/03/24 14:21:08 thorpej Exp $ */ /*- * Copyright (c) 1996, 1998 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: pcib.c,v 1.19 2019/10/04 12:23:37 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pcib.c,v 1.19.10.1 2021/03/24 14:21:08 thorpej Exp $"); #include <sys/types.h> #include <sys/param.h> @@ -228,6 +228,11 @@ pcibrescan(device_t self, const char *if struct pcib_softc *sc = device_private(self); struct isabus_attach_args iba; + /* + * Even though pcib only has a single "isabus" interface + * attribute, this function is referenced by other drivers + * that carry more, so we go ahead and filter. + */ if (ifattr_match(ifattr, "isabus") && sc->sc_isabus == NULL) { /* * Attach the ISA bus behind this bridge. @@ -239,7 +244,9 @@ pcibrescan(device_t self, const char *if iba.iba_dmat = &isa_bus_dma_tag; #endif sc->sc_isabus = - config_found_ia(self, "isabus", &iba, isabusprint); + config_found(self, &iba, isabusprint, + CFARG_IATTR, "isabus", + CFARG_EOL); } return 0; } Index: src/sys/dev/acpi/wmi/wmi_acpi.c diff -u src/sys/dev/acpi/wmi/wmi_acpi.c:1.17 src/sys/dev/acpi/wmi/wmi_acpi.c:1.17.2.1 --- src/sys/dev/acpi/wmi/wmi_acpi.c:1.17 Fri Jan 29 15:49:55 2021 +++ src/sys/dev/acpi/wmi/wmi_acpi.c Wed Mar 24 14:21:08 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: wmi_acpi.c,v 1.17 2021/01/29 15:49:55 thorpej Exp $ */ +/* $NetBSD: wmi_acpi.c,v 1.17.2.1 2021/03/24 14:21:08 thorpej Exp $ */ /*- * Copyright (c) 2009, 2010 Jukka Ruohonen <jruoho...@iki.fi> @@ -27,7 +27,7 @@ * SUCH DAMAGE. */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: wmi_acpi.c,v 1.17 2021/01/29 15:49:55 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wmi_acpi.c,v 1.17.2.1 2021/03/24 14:21:08 thorpej Exp $"); #include <sys/param.h> #include <sys/device.h> @@ -149,9 +149,10 @@ acpi_wmi_rescan(device_t self, const cha { struct acpi_wmi_softc *sc = device_private(self); - if (ifattr_match(ifattr, "acpiwmibus") && sc->sc_child == NULL) - sc->sc_child = config_found_ia(self, "acpiwmibus", - NULL, acpi_wmi_print); + if (sc->sc_child == NULL) { + sc->sc_child = + config_found(self, NULL, acpi_wmi_print, CFARG_EOL); + } return 0; } Index: src/sys/dev/hdaudio/hdaudio.c diff -u src/sys/dev/hdaudio/hdaudio.c:1.13.2.2 src/sys/dev/hdaudio/hdaudio.c:1.13.2.3 --- src/sys/dev/hdaudio/hdaudio.c:1.13.2.2 Mon Mar 22 16:23:44 2021 +++ src/sys/dev/hdaudio/hdaudio.c Wed Mar 24 14:21:08 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: hdaudio.c,v 1.13.2.2 2021/03/22 16:23:44 thorpej Exp $ */ +/* $NetBSD: hdaudio.c,v 1.13.2.3 2021/03/24 14:21:08 thorpej Exp $ */ /* * Copyright (c) 2009 Precedence Technologies Ltd <supp...@precedence.co.uk> @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: hdaudio.c,v 1.13.2.2 2021/03/22 16:23:44 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: hdaudio.c,v 1.13.2.3 2021/03/24 14:21:08 thorpej Exp $"); #include <sys/types.h> #include <sys/param.h> @@ -948,9 +948,6 @@ hdaudio_rescan(struct hdaudio_softc *sc, struct hdaudio_function_group *fg; unsigned int codec; - if (!ifattr_match(ifattr, "hdaudiobus")) - return 0; - for (codec = 0; codec < HDAUDIO_MAX_CODECS; codec++) { co = &sc->sc_codec[codec]; fg = co->co_fg; Index: src/sys/dev/pci/ichsmb.c diff -u src/sys/dev/pci/ichsmb.c:1.69 src/sys/dev/pci/ichsmb.c:1.69.2.1 --- src/sys/dev/pci/ichsmb.c:1.69 Fri Jan 15 14:07:15 2021 +++ src/sys/dev/pci/ichsmb.c Wed Mar 24 14:21:08 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: ichsmb.c,v 1.69 2021/01/15 14:07:15 thorpej Exp $ */ +/* $NetBSD: ichsmb.c,v 1.69.2.1 2021/03/24 14:21:08 thorpej Exp $ */ /* $OpenBSD: ichiic.c,v 1.44 2020/10/07 11:23:05 jsg Exp $ */ /* @@ -22,7 +22,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ichsmb.c,v 1.69 2021/01/15 14:07:15 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ichsmb.c,v 1.69.2.1 2021/03/24 14:21:08 thorpej Exp $"); #include <sys/param.h> #include <sys/device.h> @@ -163,7 +163,6 @@ ichsmb_attach(device_t parent, device_t pcireg_t conf; const char *intrstr = NULL; char intrbuf[PCI_INTRSTR_LEN]; - int flags; sc->sc_dev = self; sc->sc_pc = pa->pa_pc; @@ -218,23 +217,19 @@ ichsmb_attach(device_t parent, device_t } sc->sc_i2c_device = NULL; - flags = 0; - ichsmb_rescan(self, "i2cbus", &flags); + ichsmb_rescan(self, NULL, NULL); out: if (!pmf_device_register(self, NULL, NULL)) aprint_error_dev(self, "couldn't establish power handler\n"); } static int -ichsmb_rescan(device_t self, const char *ifattr, const int *flags) +ichsmb_rescan(device_t self, const char *ifattr, const int *locators) { struct ichsmb_softc *sc = device_private(self); struct i2cbus_attach_args iba; - if (!ifattr_match(ifattr, "i2cbus")) - return 0; - - if (sc->sc_i2c_device) + if (sc->sc_i2c_device != NULL) return 0; /* Attach I2C bus */ @@ -244,7 +239,7 @@ ichsmb_rescan(device_t self, const char memset(&iba, 0, sizeof(iba)); iba.iba_tag = &sc->sc_i2c_tag; - sc->sc_i2c_device = config_found_ia(self, ifattr, &iba, iicbus_print); + sc->sc_i2c_device = config_found(self, &iba, iicbus_print, CFARG_EOL); return 0; } Index: src/sys/dev/pci/ismt.c diff -u src/sys/dev/pci/ismt.c:1.7 src/sys/dev/pci/ismt.c:1.7.10.1 --- src/sys/dev/pci/ismt.c:1.7 Sun Dec 22 23:23:32 2019 +++ src/sys/dev/pci/ismt.c Wed Mar 24 14:21:08 2021 @@ -60,7 +60,7 @@ #if 0 __FBSDID("$FreeBSD: head/sys/dev/ismt/ismt.c 266474 2014-05-20 19:55:06Z jimharris $"); #endif -__KERNEL_RCSID(0, "$NetBSD: ismt.c,v 1.7 2019/12/22 23:23:32 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ismt.c,v 1.7.10.1 2021/03/24 14:21:08 thorpej Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -787,15 +787,12 @@ ismt_match(device_t parent, cfdata_t mat } static int -ismt_rescan(device_t self, const char *ifattr, const int *flags) +ismt_rescan(device_t self, const char *ifattr, const int *locators) { struct ismt_softc *sc = device_private(self); struct i2cbus_attach_args iba; - if (!ifattr_match(ifattr, "i2cbus")) - return 0; - - if (sc->smbdev) + if (sc->smbdev != NULL) return 0; /* Attach I2C bus */ @@ -805,7 +802,7 @@ ismt_rescan(device_t self, const char *i memset(&iba, 0, sizeof(iba)); iba.iba_tag = &sc->sc_i2c_tag; - sc->smbdev = config_found_ia(self, ifattr, &iba, iicbus_print); + sc->smbdev = config_found(self, &iba, iicbus_print, CFARG_EOL); return 0; } @@ -815,7 +812,7 @@ ismt_config_interrupts(device_t self) { int flags = 0; - ismt_rescan(self, "i2cbus", &flags); + ismt_rescan(self, NULL, NULL); } static void Index: src/sys/dev/pci/piixpm.c diff -u src/sys/dev/pci/piixpm.c:1.63 src/sys/dev/pci/piixpm.c:1.63.8.1 --- src/sys/dev/pci/piixpm.c:1.63 Tue Jan 14 15:42:03 2020 +++ src/sys/dev/pci/piixpm.c Wed Mar 24 14:21:08 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: piixpm.c,v 1.63 2020/01/14 15:42:03 msaitoh Exp $ */ +/* $NetBSD: piixpm.c,v 1.63.8.1 2021/03/24 14:21:08 thorpej Exp $ */ /* $OpenBSD: piixpm.c,v 1.39 2013/10/01 20:06:02 sf Exp $ */ /* @@ -22,7 +22,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: piixpm.c,v 1.63 2020/01/14 15:42:03 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: piixpm.c,v 1.63.8.1 2021/03/24 14:21:08 thorpej Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -192,7 +192,7 @@ piixpm_attach(device_t parent, device_t pci_intr_handle_t ih; bool usesmi = false; const char *intrstr = NULL; - int i, flags; + int i; char intrbuf[PCI_INTRSTR_LEN]; sc->sc_dev = self; @@ -304,8 +304,7 @@ setintr: for (i = 0; i < sc->sc_numbusses; i++) sc->sc_i2c_device[i] = NULL; - flags = 0; - piixpm_rescan(self, "i2cbus", &flags); + piixpm_rescan(self, NULL, NULL); } static int @@ -322,22 +321,20 @@ piixpm_iicbus_print(void *aux, const cha return UNCONF; } + static int -piixpm_rescan(device_t self, const char *ifattr, const int *flags) +piixpm_rescan(device_t self, const char *ifattr, const int *locators) { struct piixpm_softc *sc = device_private(self); struct i2cbus_attach_args iba; int i; - if (!ifattr_match(ifattr, "i2cbus")) - return 0; - /* Attach I2C bus */ for (i = 0; i < sc->sc_numbusses; i++) { struct i2c_controller *tag = &sc->sc_i2c_tags[i]; - if (sc->sc_i2c_device[i]) + if (sc->sc_i2c_device[i] != NULL) continue; sc->sc_busses[i].sda = i; sc->sc_busses[i].softc = sc; @@ -353,8 +350,8 @@ piixpm_rescan(device_t self, const char tag->ic_exec = piixpm_i2c_exec; memset(&iba, 0, sizeof(iba)); iba.iba_tag = tag; - sc->sc_i2c_device[i] = config_found_ia(self, ifattr, &iba, - piixpm_iicbus_print); + sc->sc_i2c_device[i] = + config_found(self, &iba, piixpm_iicbus_print, CFARG_EOL); } return 0;