Module Name: src
Committed By: thorpej
Date: Sun Mar 21 19:06:19 UTC 2021
Modified Files:
src/sys/arch/x86/pci [thorpej-cfargs]: amdnb_misc.c amdsmn.c
src/sys/dev/audio [thorpej-cfargs]: audio.c
src/sys/dev/i2c [thorpej-cfargs]: i2c.c
src/sys/dev/isa [thorpej-cfargs]: pcppi.c
Log Message:
In "rescan" routines, always pass locators and the interface attribute
straight through to config_search(). Also, for devices that carry only
one interface attribute, no need to do an ifattr_match(), because
rescan_with_cfdata() will have already validated that the parent is
eligible, which includes an interface attribute check.
To generate a diff of this commit:
cvs rdiff -u -r1.3.14.2 -r1.3.14.3 src/sys/arch/x86/pci/amdnb_misc.c
cvs rdiff -u -r1.10.4.1 -r1.10.4.2 src/sys/arch/x86/pci/amdsmn.c
cvs rdiff -u -r1.91.2.1 -r1.91.2.2 src/sys/dev/audio/audio.c
cvs rdiff -u -r1.77.2.1 -r1.77.2.2 src/sys/dev/i2c/i2c.c
cvs rdiff -u -r1.45.22.1 -r1.45.22.2 src/sys/dev/isa/pcppi.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/x86/pci/amdnb_misc.c
diff -u src/sys/arch/x86/pci/amdnb_misc.c:1.3.14.2 src/sys/arch/x86/pci/amdnb_misc.c:1.3.14.3
--- src/sys/arch/x86/pci/amdnb_misc.c:1.3.14.2 Sun Mar 21 17:35:48 2021
+++ src/sys/arch/x86/pci/amdnb_misc.c Sun Mar 21 19:06:19 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: amdnb_misc.c,v 1.3.14.2 2021/03/21 17:35:48 thorpej Exp $ */
+/* $NetBSD: amdnb_misc.c,v 1.3.14.3 2021/03/21 19:06:19 thorpej Exp $ */
/*
* Copyright (c) 2012 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: amdnb_misc.c,v 1.3.14.2 2021/03/21 17:35:48 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: amdnb_misc.c,v 1.3.14.3 2021/03/21 19:06:19 thorpej Exp $");
#include <sys/param.h>
#include <sys/device.h>
@@ -158,9 +158,6 @@ amdnb_misc_rescan(device_t self, const c
{
struct amdnb_misc_softc *sc = device_private(self);
- if (!ifattr_match(ifattr, "amdnb_miscbus"))
- return 0;
-
config_search(self, &sc->sc_pa,
CFARG_SUBMATCH, amdnb_misc_search,
CFARG_IATTR, ifattr,
Index: src/sys/arch/x86/pci/amdsmn.c
diff -u src/sys/arch/x86/pci/amdsmn.c:1.10.4.1 src/sys/arch/x86/pci/amdsmn.c:1.10.4.2
--- src/sys/arch/x86/pci/amdsmn.c:1.10.4.1 Sat Mar 20 19:33:39 2021
+++ src/sys/arch/x86/pci/amdsmn.c Sun Mar 21 19:06:19 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: amdsmn.c,v 1.10.4.1 2021/03/20 19:33:39 thorpej Exp $ */
+/* $NetBSD: amdsmn.c,v 1.10.4.2 2021/03/21 19:06:19 thorpej Exp $ */
/*-
* Copyright (c) 2017, 2019 Conrad Meyer <[email protected]>
@@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: amdsmn.c,v 1.10.4.1 2021/03/20 19:33:39 thorpej Exp $ ");
+__KERNEL_RCSID(0, "$NetBSD: amdsmn.c,v 1.10.4.2 2021/03/21 19:06:19 thorpej Exp $ ");
/*
* Driver for the AMD Family 15h (model 60+) and 17h CPU
@@ -153,13 +153,14 @@ amdsmn_attach(device_t parent, device_t
}
static int
-amdsmn_rescan(device_t self, const char *ifattr, const int *flags)
+amdsmn_rescan(device_t self, const char *ifattr, const int *locators)
{
struct amdsmn_softc *sc = device_private(self);
config_search(self, &sc->pa,
CFARG_SUBMATCH, amdsmn_misc_search,
CFARG_IATTR, ifattr,
+ CFARG_LOCATORS, locators,
CFARG_EOL);
return 0;
Index: src/sys/dev/audio/audio.c
diff -u src/sys/dev/audio/audio.c:1.91.2.1 src/sys/dev/audio/audio.c:1.91.2.2
--- src/sys/dev/audio/audio.c:1.91.2.1 Sat Mar 20 19:33:40 2021
+++ src/sys/dev/audio/audio.c Sun Mar 21 19:06:19 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: audio.c,v 1.91.2.1 2021/03/20 19:33:40 thorpej Exp $ */
+/* $NetBSD: audio.c,v 1.91.2.2 2021/03/21 19:06:19 thorpej Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -138,7 +138,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.91.2.1 2021/03/20 19:33:40 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.91.2.2 2021/03/21 19:06:19 thorpej Exp $");
#ifdef _KERNEL_OPT
#include "audio.h"
@@ -1410,16 +1410,14 @@ audiosearch(device_t parent, cfdata_t cf
}
static int
-audiorescan(device_t self, const char *ifattr, const int *flags)
+audiorescan(device_t self, const char *ifattr, const int *locators)
{
struct audio_softc *sc = device_private(self);
- if (!ifattr_match(ifattr, "audio"))
- return 0;
-
config_search(sc->sc_dev, NULL,
CFARG_SUBMATCH, audiosearch,
- CFARG_IATTR, "audio",
+ CFARG_IATTR, ifattr,
+ CFARG_LOCATORS, locators,
CFARG_EOL);
return 0;
Index: src/sys/dev/i2c/i2c.c
diff -u src/sys/dev/i2c/i2c.c:1.77.2.1 src/sys/dev/i2c/i2c.c:1.77.2.2
--- src/sys/dev/i2c/i2c.c:1.77.2.1 Sat Mar 20 19:33:40 2021
+++ src/sys/dev/i2c/i2c.c Sun Mar 21 19:06:19 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: i2c.c,v 1.77.2.1 2021/03/20 19:33:40 thorpej Exp $ */
+/* $NetBSD: i2c.c,v 1.77.2.2 2021/03/21 19:06:19 thorpej Exp $ */
/*
* Copyright (c) 2003 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
#endif
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i2c.c,v 1.77.2.1 2021/03/20 19:33:40 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i2c.c,v 1.77.2.2 2021/03/21 19:06:19 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -383,6 +383,7 @@ iic_rescan(device_t self, const char *if
config_search(self, NULL,
CFARG_SUBMATCH, iic_search,
CFARG_IATTR, ifattr,
+ CFARG_LOCATORS, locators,
CFARG_EOL);
return 0;
}
Index: src/sys/dev/isa/pcppi.c
diff -u src/sys/dev/isa/pcppi.c:1.45.22.1 src/sys/dev/isa/pcppi.c:1.45.22.2
--- src/sys/dev/isa/pcppi.c:1.45.22.1 Sat Mar 20 19:33:40 2021
+++ src/sys/dev/isa/pcppi.c Sun Mar 21 19:06:19 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: pcppi.c,v 1.45.22.1 2021/03/20 19:33:40 thorpej Exp $ */
+/* $NetBSD: pcppi.c,v 1.45.22.2 2021/03/21 19:06:19 thorpej Exp $ */
/*
* Copyright (c) 1996 Carnegie-Mellon University.
@@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pcppi.c,v 1.45.22.1 2021/03/20 19:33:40 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pcppi.c,v 1.45.22.2 2021/03/21 19:06:19 thorpej Exp $");
#include "attimer.h"
@@ -233,23 +233,22 @@ pcppi_attach(struct pcppi_softc *sc)
if (!pmf_device_register(self, NULL, NULL))
aprint_error_dev(self, "couldn't establish power handler\n");
- pcppi_rescan(self, "pcppi", NULL);
+ pcppi_rescan(self, NULL, NULL);
}
int
-pcppi_rescan(device_t self, const char *ifattr, const int *flags)
+pcppi_rescan(device_t self, const char *ifattr, const int *locators)
{
struct pcppi_softc *sc = device_private(self);
struct pcppi_attach_args pa;
- if (!ifattr_match(ifattr, "pcppi"))
- return 0;
-
pa.pa_cookie = sc;
pa.pa_bell_func = pcppi_bell;
+
config_search(sc->sc_dv, &pa,
CFARG_SUBMATCH, pcppisearch,
- CFARG_IATTR, "pcppi",
+ CFARG_IATTR, ifattr,
+ CFARG_LOCATORS, locators,
CFARG_EOL);
return 0;