summaryrefslogtreecommitdiff
path: root/sys/dev/usb
diff options
context:
space:
mode:
authorthorpej <thorpej@NetBSD.org>2021-04-24 23:36:23 +0000
committerthorpej <thorpej@NetBSD.org>2021-04-24 23:36:23 +0000
commit3bee0c110b9ff2a9a0e2833be339e1c873af3a44 (patch)
tree82c9f34b9867882723e76eff95e5d7ca6cab69bf /sys/dev/usb
parente77b3a7c4b6598de68d8b78f86e7851410840595 (diff)
Merge thorpej-cfargs branch:
Simplify and make extensible the config_search() / config_found() / config_attach() interfaces: rather than having different variants for which arguments you want pass along, just have a single call that takes a variadic list of tag-value arguments. Adjust all call sites: - Simplify wherever possible; don't pass along arguments that aren't actually needed. - Don't be explicit about what interface attribute is attaching if the device only has one. (More simplification.) - Add a config_probe() function to be used in indirect configuiration situations, making is visibly easier to see when indirect config is in play, and allowing for future change in semantics. (As of now, this is just a wrapper around config_match(), but that is an implementation detail.) Remove unnecessary or redundant interface attributes where they're not needed. There are currently 5 "cfargs" defined: - CFARG_SUBMATCH (submatch function for direct config) - CFARG_SEARCH (search function for indirect config) - CFARG_IATTR (interface attribte) - CFARG_LOCATORS (locators array) - CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles) ...and a sentinel value CFARG_EOL. Add some extra sanity checking to ensure that interface attributes aren't ambiguous. Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark ports to associate those device handles with device_t instance. This will trickle trough to more places over time (need back-end for pre-OFW Sun OBP; any others?).
Diffstat (limited to 'sys/dev/usb')
-rw-r--r--sys/dev/usb/auvitek_audio.c12
-rw-r--r--sys/dev/usb/auvitek_dtv.c9
-rw-r--r--sys/dev/usb/auvitek_i2c.c9
-rw-r--r--sys/dev/usb/emdtv_dtv.c9
-rw-r--r--sys/dev/usb/emdtv_ir.c8
-rw-r--r--sys/dev/usb/irmce.c8
-rw-r--r--sys/dev/usb/motg.c7
-rw-r--r--sys/dev/usb/u3g.c9
-rw-r--r--sys/dev/usb/uark.c9
-rw-r--r--sys/dev/usb/uatp.c7
-rw-r--r--sys/dev/usb/ubsa.c9
-rw-r--r--sys/dev/usb/uchcom.c9
-rw-r--r--sys/dev/usb/udl.c6
-rw-r--r--sys/dev/usb/udsir.c6
-rw-r--r--sys/dev/usb/uep.c6
-rw-r--r--sys/dev/usb/uftdi.c9
-rw-r--r--sys/dev/usb/ugensa.c9
-rw-r--r--sys/dev/usb/uhidev.c11
-rw-r--r--sys/dev/usb/uhmodem.c9
-rw-r--r--sys/dev/usb/uipaq.c9
-rw-r--r--sys/dev/usb/uirda.c6
-rw-r--r--sys/dev/usb/ukbd.c6
-rw-r--r--sys/dev/usb/umass_scsipi.c14
-rw-r--r--sys/dev/usb/umcs.c9
-rw-r--r--sys/dev/usb/umct.c9
-rw-r--r--sys/dev/usb/umodem_common.c9
-rw-r--r--sys/dev/usb/uplcom.c9
-rw-r--r--sys/dev/usb/usb_subr.c22
-rw-r--r--sys/dev/usb/uslsa.c9
-rw-r--r--sys/dev/usb/usscanner.c7
-rw-r--r--sys/dev/usb/ustir.c6
-rw-r--r--sys/dev/usb/uts.c6
-rw-r--r--sys/dev/usb/uvisor.c19
-rw-r--r--sys/dev/usb/uvscom.c9
-rw-r--r--sys/dev/usb/vhci.c6
35 files changed, 176 insertions, 140 deletions
diff --git a/sys/dev/usb/auvitek_audio.c b/sys/dev/usb/auvitek_audio.c
index 73177d86fc1..6acce9fce87 100644
--- a/sys/dev/usb/auvitek_audio.c
+++ b/sys/dev/usb/auvitek_audio.c
@@ -1,4 +1,4 @@
-/* $NetBSD: auvitek_audio.c,v 1.3 2017/06/01 02:45:11 chs Exp $ */
+/* $NetBSD: auvitek_audio.c,v 1.4 2021/04/24 23:36:59 thorpej Exp $ */
/*-
* Copyright (c) 2010 Jared D. McNeill <jmcneill@invisible.ca>
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: auvitek_audio.c,v 1.3 2017/06/01 02:45:11 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: auvitek_audio.c,v 1.4 2021/04/24 23:36:59 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -95,8 +95,12 @@ auvitek_audio_attach(struct auvitek_softc *sc)
uiaa.uiaa_proto = ifaces[i]->ui_idesc->bInterfaceProtocol;
uiaa.uiaa_ifaceno = ifaces[i]->ui_idesc->bInterfaceNumber;
ilocs[USBIFIFCF_INTERFACE] = uiaa.uiaa_ifaceno;
- sc->sc_audiodev = config_found_sm_loc(sc->sc_dev, "usbifif",
- ilocs, &uiaa, auvitek_ifprint, config_stdsubmatch);
+ sc->sc_audiodev =
+ config_found(sc->sc_dev, &uiaa, auvitek_ifprint,
+ CFARG_SUBMATCH, config_stdsubmatch,
+ CFARG_IATTR, "usbifif",
+ CFARG_LOCATORS, ilocs,
+ CFARG_EOL);
if (sc->sc_audiodev)
break;
}
diff --git a/sys/dev/usb/auvitek_dtv.c b/sys/dev/usb/auvitek_dtv.c
index 6cfa95909a1..dce8377921c 100644
--- a/sys/dev/usb/auvitek_dtv.c
+++ b/sys/dev/usb/auvitek_dtv.c
@@ -1,4 +1,4 @@
-/* $NetBSD: auvitek_dtv.c,v 1.7 2016/04/23 10:15:31 skrll Exp $ */
+/* $NetBSD: auvitek_dtv.c,v 1.8 2021/04/24 23:36:59 thorpej Exp $ */
/*-
* Copyright (c) 2011 Jared D. McNeill <jmcneill@invisible.ca>
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: auvitek_dtv.c,v 1.7 2016/04/23 10:15:31 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: auvitek_dtv.c,v 1.8 2021/04/24 23:36:59 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -116,8 +116,9 @@ auvitek_dtv_rescan(struct auvitek_softc *sc, const char *ifattr,
daa.priv = sc;
if (ifattr_match(ifattr, "dtvbus") && sc->sc_dtvdev == NULL)
- sc->sc_dtvdev = config_found_ia(sc->sc_dev, "dtvbus",
- &daa, dtv_print);
+ sc->sc_dtvdev = config_found(sc->sc_dev, &daa, dtv_print,
+ CFARG_IATTR, "dtvbus",
+ CFARG_EOL);
}
void
diff --git a/sys/dev/usb/auvitek_i2c.c b/sys/dev/usb/auvitek_i2c.c
index 3a52dfed66b..4650927449e 100644
--- a/sys/dev/usb/auvitek_i2c.c
+++ b/sys/dev/usb/auvitek_i2c.c
@@ -1,4 +1,4 @@
-/* $NetBSD: auvitek_i2c.c,v 1.5 2019/12/22 23:23:32 thorpej Exp $ */
+/* $NetBSD: auvitek_i2c.c,v 1.6 2021/04/24 23:36:59 thorpej Exp $ */
/*-
* Copyright (c) 2010 Jared D. McNeill <jmcneill@invisible.ca>
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: auvitek_i2c.c,v 1.5 2019/12/22 23:23:32 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: auvitek_i2c.c,v 1.6 2021/04/24 23:36:59 thorpej Exp $");
#ifdef _KERNEL_OPT
#include "opt_usb.h"
@@ -101,8 +101,9 @@ auvitek_i2c_rescan(struct auvitek_softc *sc, const char *ifattr,
if (ifattr_match(ifattr, "i2cbus") && sc->sc_i2cdev == NULL) {
memset(&iba, 0, sizeof(iba));
iba.iba_tag = &sc->sc_i2c;
- sc->sc_i2cdev = config_found_ia(sc->sc_dev, "i2cbus",
- &iba, iicbus_print);
+ sc->sc_i2cdev = config_found(sc->sc_dev, &iba, iicbus_print,
+ CFARG_IATTR, "i2cbus",
+ CFARG_EOL);
}
#endif
}
diff --git a/sys/dev/usb/emdtv_dtv.c b/sys/dev/usb/emdtv_dtv.c
index 0b8c387786a..074f5fb0c53 100644
--- a/sys/dev/usb/emdtv_dtv.c
+++ b/sys/dev/usb/emdtv_dtv.c
@@ -1,4 +1,4 @@
-/* $NetBSD: emdtv_dtv.c,v 1.14 2020/03/14 02:35:33 christos Exp $ */
+/* $NetBSD: emdtv_dtv.c,v 1.15 2021/04/24 23:36:59 thorpej Exp $ */
/*-
* Copyright (c) 2008, 2011 Jared D. McNeill <jmcneill@invisible.ca>
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: emdtv_dtv.c,v 1.14 2020/03/14 02:35:33 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: emdtv_dtv.c,v 1.15 2021/04/24 23:36:59 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -171,8 +171,9 @@ emdtv_dtv_rescan(struct emdtv_softc *sc, const char *ifattr, const int *locs)
daa.priv = sc;
if (ifattr_match(ifattr, "dtvbus") && sc->sc_dtvdev == NULL)
- sc->sc_dtvdev = config_found_ia(sc->sc_dev, "dtvbus",
- &daa, dtv_print);
+ sc->sc_dtvdev = config_found(sc->sc_dev, &daa, dtv_print,
+ CFARG_IATTR, "dtvbus",
+ CFARG_EOL);
}
static void
diff --git a/sys/dev/usb/emdtv_ir.c b/sys/dev/usb/emdtv_ir.c
index 016afd57421..c3e5e82cb6c 100644
--- a/sys/dev/usb/emdtv_ir.c
+++ b/sys/dev/usb/emdtv_ir.c
@@ -1,4 +1,4 @@
-/* $NetBSD: emdtv_ir.c,v 1.2 2016/04/23 10:15:31 skrll Exp $ */
+/* $NetBSD: emdtv_ir.c,v 1.3 2021/04/24 23:36:59 thorpej Exp $ */
/*-
* Copyright (c) 2008 Jared D. McNeill <jmcneill@invisible.ca>
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: emdtv_ir.c,v 1.2 2016/04/23 10:15:31 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: emdtv_ir.c,v 1.3 2021/04/24 23:36:59 thorpej Exp $");
#include <sys/select.h>
#include <sys/param.h>
@@ -101,7 +101,9 @@ emdtv_ir_attach(struct emdtv_softc *sc)
ia.ia_handle = sc;
sc->sc_cirdev =
- config_found_ia(sc->sc_dev, "irbus", &ia, ir_print);
+ config_found(sc->sc_dev, &ia, ir_print,
+ CFARG_IATTR, "irbus",
+ CFARG_EOL);
}
void
diff --git a/sys/dev/usb/irmce.c b/sys/dev/usb/irmce.c
index 9e2aef0082c..41db14bb02d 100644
--- a/sys/dev/usb/irmce.c
+++ b/sys/dev/usb/irmce.c
@@ -1,4 +1,4 @@
-/* $NetBSD: irmce.c,v 1.6 2020/03/14 02:35:33 christos Exp $ */
+/* $NetBSD: irmce.c,v 1.7 2021/04/24 23:36:59 thorpej Exp $ */
/*-
* Copyright (c) 2011 Jared D. McNeill <jmcneill@invisible.ca>
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: irmce.c,v 1.6 2020/03/14 02:35:33 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: irmce.c,v 1.7 2021/04/24 23:36:59 thorpej Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -307,8 +307,8 @@ irmce_rescan(device_t self, const char *ifattr, const int *locators)
iaa.ia_type = IR_TYPE_CIR;
iaa.ia_methods = &irmce_cir_methods;
iaa.ia_handle = sc;
- sc->sc_cirdev = config_found_ia(self, "irbus",
- &iaa, irmce_print);
+ sc->sc_cirdev =
+ config_found(self, &iaa, irmce_print, CFARG_EOL);
}
return 0;
diff --git a/sys/dev/usb/motg.c b/sys/dev/usb/motg.c
index c94e4109049..df6c470c6a2 100644
--- a/sys/dev/usb/motg.c
+++ b/sys/dev/usb/motg.c
@@ -1,4 +1,4 @@
-/* $NetBSD: motg.c,v 1.35 2020/03/14 02:35:33 christos Exp $ */
+/* $NetBSD: motg.c,v 1.36 2021/04/24 23:36:59 thorpej Exp $ */
/*
* Copyright (c) 1998, 2004, 2011, 2012, 2014 The NetBSD Foundation, Inc.
@@ -40,7 +40,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: motg.c,v 1.35 2020/03/14 02:35:33 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: motg.c,v 1.36 2021/04/24 23:36:59 thorpej Exp $");
#ifdef _KERNEL_OPT
#include "opt_usb.h"
@@ -471,7 +471,8 @@ motg_init(struct motg_softc *sc)
sc->sc_bus.ub_revision = USBREV_2_0;
sc->sc_bus.ub_usedma = false;
sc->sc_bus.ub_hcpriv = sc;
- sc->sc_child = config_found(sc->sc_dev, &sc->sc_bus, usbctlprint);
+ sc->sc_child = config_found(sc->sc_dev, &sc->sc_bus, usbctlprint,
+ CFARG_EOL);
return 0;
}
diff --git a/sys/dev/usb/u3g.c b/sys/dev/usb/u3g.c
index be51ae01870..8665499fb26 100644
--- a/sys/dev/usb/u3g.c
+++ b/sys/dev/usb/u3g.c
@@ -1,4 +1,4 @@
-/* $NetBSD: u3g.c,v 1.41 2020/06/05 08:02:32 skrll Exp $ */
+/* $NetBSD: u3g.c,v 1.42 2021/04/24 23:36:59 thorpej Exp $ */
/*-
* Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -50,7 +50,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: u3g.c,v 1.41 2020/06/05 08:02:32 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: u3g.c,v 1.42 2021/04/24 23:36:59 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -386,8 +386,9 @@ u3g_attach(device_t parent, device_t self, void *aux)
com->c_msr = UMSR_DSR | UMSR_CTS | UMSR_DCD;
com->c_open = false;
com->c_purging = false;
- com->c_dev = config_found_sm_loc(self, "ucombus",
- NULL, &ucaa, ucomprint, ucomsubmatch);
+ com->c_dev = config_found(self, &ucaa, ucomprint,
+ CFARG_SUBMATCH, ucomsubmatch,
+ CFARG_EOL);
ucaa.ucaa_bulkin = -1;
ucaa.ucaa_bulkout = -1;
}
diff --git a/sys/dev/usb/uark.c b/sys/dev/usb/uark.c
index 9502ae6fd11..d08ea78f1fb 100644
--- a/sys/dev/usb/uark.c
+++ b/sys/dev/usb/uark.c
@@ -1,4 +1,4 @@
-/* $NetBSD: uark.c,v 1.16 2020/01/07 06:42:26 maxv Exp $ */
+/* $NetBSD: uark.c,v 1.17 2021/04/24 23:36:59 thorpej Exp $ */
/* $OpenBSD: uark.c,v 1.13 2009/10/13 19:33:17 pirofti Exp $ */
/*
@@ -18,7 +18,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uark.c,v 1.16 2020/01/07 06:42:26 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uark.c,v 1.17 2021/04/24 23:36:59 thorpej Exp $");
#ifdef _KERNEL_OPT
#include "opt_usb.h"
@@ -190,8 +190,9 @@ uark_attach(device_t parent, device_t self, void *aux)
usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->sc_udev, sc->sc_dev);
- sc->sc_subdev = config_found_sm_loc(self, "ucombus", NULL, &ucaa,
- ucomprint, ucomsubmatch);
+ sc->sc_subdev = config_found(self, &ucaa, ucomprint,
+ CFARG_SUBMATCH, ucomsubmatch,
+ CFARG_EOL);
return;
}
diff --git a/sys/dev/usb/uatp.c b/sys/dev/usb/uatp.c
index ccfb0ac616e..67213de9d22 100644
--- a/sys/dev/usb/uatp.c
+++ b/sys/dev/usb/uatp.c
@@ -1,4 +1,4 @@
-/* $NetBSD: uatp.c,v 1.25 2020/03/14 02:35:33 christos Exp $ */
+/* $NetBSD: uatp.c,v 1.26 2021/04/24 23:36:59 thorpej Exp $ */
/*-
* Copyright (c) 2011-2014 The NetBSD Foundation, Inc.
@@ -146,7 +146,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uatp.c,v 1.25 2020/03/14 02:35:33 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uatp.c,v 1.26 2021/04/24 23:36:59 thorpej Exp $");
#ifdef _KERNEL_OPT
#include "opt_usb.h"
@@ -985,8 +985,7 @@ uatp_attach(device_t parent, device_t self, void *aux)
/* Attach wsmouse. */
a.accessops = &uatp_accessops;
a.accesscookie = sc;
- sc->sc_wsmousedev = config_found_ia(self, "wsmousedev", &a,
- wsmousedevprint);
+ sc->sc_wsmousedev = config_found(self, &a, wsmousedevprint, CFARG_EOL);
}
/* Sysctl setup */
diff --git a/sys/dev/usb/ubsa.c b/sys/dev/usb/ubsa.c
index dd40a5ee305..8727389137a 100644
--- a/sys/dev/usb/ubsa.c
+++ b/sys/dev/usb/ubsa.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ubsa.c,v 1.40 2020/03/13 18:17:40 christos Exp $ */
+/* $NetBSD: ubsa.c,v 1.41 2021/04/24 23:36:59 thorpej Exp $ */
/*-
* Copyright (c) 2002, Alexander Kabaev <kan.FreeBSD.org>.
@@ -55,7 +55,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ubsa.c,v 1.40 2020/03/13 18:17:40 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ubsa.c,v 1.41 2021/04/24 23:36:59 thorpej Exp $");
#ifdef _KERNEL_OPT
#include "opt_usb.h"
@@ -280,8 +280,9 @@ ubsa_attach(device_t parent, device_t self, void *aux)
ucaa.ucaa_info = NULL;
DPRINTF(("ubsa: int#=%d, in = %#x, out = %#x, intr = %#x\n",
i, ucaa.ucaa_bulkin, ucaa.ucaa_bulkout, sc->sc_intr_number));
- sc->sc_subdevs[0] = config_found_sm_loc(self, "ucombus", NULL, &ucaa,
- ucomprint, ucomsubmatch);
+ sc->sc_subdevs[0] = config_found(self, &ucaa, ucomprint,
+ CFARG_SUBMATCH, ucomsubmatch,
+ CFARG_EOL);
usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->sc_udev, sc->sc_dev);
diff --git a/sys/dev/usb/uchcom.c b/sys/dev/usb/uchcom.c
index d59a9a90b53..e5bd29b4672 100644
--- a/sys/dev/usb/uchcom.c
+++ b/sys/dev/usb/uchcom.c
@@ -1,4 +1,4 @@
-/* $NetBSD: uchcom.c,v 1.36 2020/03/14 02:35:33 christos Exp $ */
+/* $NetBSD: uchcom.c,v 1.37 2021/04/24 23:36:59 thorpej Exp $ */
/*
* Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uchcom.c,v 1.36 2020/03/14 02:35:33 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uchcom.c,v 1.37 2021/04/24 23:36:59 thorpej Exp $");
#ifdef _KERNEL_OPT
#include "opt_usb.h"
@@ -273,8 +273,9 @@ uchcom_attach(device_t parent, device_t self, void *aux)
usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->sc_udev, sc->sc_dev);
- sc->sc_subdev = config_found_sm_loc(self, "ucombus", NULL, &ucaa,
- ucomprint, ucomsubmatch);
+ sc->sc_subdev = config_found(self, &ucaa, ucomprint,
+ CFARG_SUBMATCH, ucomsubmatch,
+ CFARG_EOL);
return;
diff --git a/sys/dev/usb/udl.c b/sys/dev/usb/udl.c
index cc4c625dbdd..4166954acbd 100644
--- a/sys/dev/usb/udl.c
+++ b/sys/dev/usb/udl.c
@@ -1,4 +1,4 @@
-/* $NetBSD: udl.c,v 1.25 2020/09/05 16:30:11 riastradh Exp $ */
+/* $NetBSD: udl.c,v 1.26 2021/04/24 23:36:59 thorpej Exp $ */
/*-
* Copyright (c) 2009 FUKAUMI Naoki.
@@ -53,7 +53,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: udl.c,v 1.25 2020/09/05 16:30:11 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: udl.c,v 1.26 2021/04/24 23:36:59 thorpej Exp $");
#ifdef _KERNEL_OPT
#include "opt_usb.h"
@@ -475,7 +475,7 @@ udl_attach(device_t parent, device_t self, void *aux)
aa.accesscookie = sc;
sc->sc_wsdisplay =
- config_found(sc->sc_dev, &aa, wsemuldisplaydevprint);
+ config_found(sc->sc_dev, &aa, wsemuldisplaydevprint, CFARG_EOL);
usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->sc_udev, sc->sc_dev);
diff --git a/sys/dev/usb/udsir.c b/sys/dev/usb/udsir.c
index 12646ce4ef7..f5446a7935e 100644
--- a/sys/dev/usb/udsir.c
+++ b/sys/dev/usb/udsir.c
@@ -1,4 +1,4 @@
-/* $NetBSD: udsir.c,v 1.12 2020/12/18 01:40:20 thorpej Exp $ */
+/* $NetBSD: udsir.c,v 1.13 2021/04/24 23:36:59 thorpej Exp $ */
/*
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: udsir.c,v 1.12 2020/12/18 01:40:20 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: udsir.c,v 1.13 2021/04/24 23:36:59 thorpej Exp $");
#include <sys/param.h>
#include <sys/device.h>
@@ -230,7 +230,7 @@ udsir_attach(device_t parent, device_t self, void *aux)
ia.ia_methods = &udsir_methods;
ia.ia_handle = sc;
- sc->sc_child = config_found(self, &ia, ir_print);
+ sc->sc_child = config_found(self, &ia, ir_print, CFARG_EOL);
selinit(&sc->sc_rd_sel);
selinit(&sc->sc_wr_sel);
diff --git a/sys/dev/usb/uep.c b/sys/dev/usb/uep.c
index f50efd0348a..d97eac0f1fb 100644
--- a/sys/dev/usb/uep.c
+++ b/sys/dev/usb/uep.c
@@ -1,4 +1,4 @@
-/* $NetBSD: uep.c,v 1.23 2019/12/01 08:27:54 maxv Exp $ */
+/* $NetBSD: uep.c,v 1.24 2021/04/24 23:36:59 thorpej Exp $ */
/*
* Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
* eGalax USB touchpanel controller driver.
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uep.c,v 1.23 2019/12/01 08:27:54 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uep.c,v 1.24 2021/04/24 23:36:59 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -223,7 +223,7 @@ uep_attach(device_t parent, device_t self, void *aux)
a.accessops = &uep_accessops;
a.accesscookie = sc;
- sc->sc_wsmousedev = config_found(self, &a, wsmousedevprint);
+ sc->sc_wsmousedev = config_found(self, &a, wsmousedevprint, CFARG_EOL);
tpcalib_init(&sc->sc_tpcalib);
tpcalib_ioctl(&sc->sc_tpcalib, WSMOUSEIO_SCALIBCOORDS,
diff --git a/sys/dev/usb/uftdi.c b/sys/dev/usb/uftdi.c
index d8cc3c4f40b..f1feaa1f61a 100644
--- a/sys/dev/usb/uftdi.c
+++ b/sys/dev/usb/uftdi.c
@@ -1,4 +1,4 @@
-/* $NetBSD: uftdi.c,v 1.74 2020/03/14 02:35:33 christos Exp $ */
+/* $NetBSD: uftdi.c,v 1.75 2021/04/24 23:36:59 thorpej Exp $ */
/*
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uftdi.c,v 1.74 2020/03/14 02:35:33 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uftdi.c,v 1.75 2021/04/24 23:36:59 thorpej Exp $");
#ifdef _KERNEL_OPT
#include "opt_usb.h"
@@ -331,8 +331,9 @@ uftdi_attach(device_t parent, device_t self, void *aux)
DPRINTF(("uftdi: in=%#x out=%#x isize=%#x osize=%#x\n",
ucaa.ucaa_bulkin, ucaa.ucaa_bulkout,
ucaa.ucaa_ibufsize, ucaa.ucaa_obufsize));
- sc->sc_subdev = config_found_sm_loc(self, "ucombus", NULL,
- &ucaa, ucomprint, ucomsubmatch);
+ sc->sc_subdev = config_found(self, &ucaa, ucomprint,
+ CFARG_SUBMATCH, ucomsubmatch,
+ CFARG_EOL);
usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->sc_udev, sc->sc_dev);
diff --git a/sys/dev/usb/ugensa.c b/sys/dev/usb/ugensa.c
index 4a0286191f0..0bd6d36006e 100644
--- a/sys/dev/usb/ugensa.c
+++ b/sys/dev/usb/ugensa.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ugensa.c,v 1.43 2020/07/04 08:07:02 ryoon Exp $ */
+/* $NetBSD: ugensa.c,v 1.44 2021/04/24 23:36:59 thorpej Exp $ */
/*
* Copyright (c) 2004, 2005 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ugensa.c,v 1.43 2020/07/04 08:07:02 ryoon Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ugensa.c,v 1.44 2021/04/24 23:36:59 thorpej Exp $");
#ifdef _KERNEL_OPT
#include "opt_usb.h"
@@ -237,8 +237,9 @@ ugensa_attach(device_t parent, device_t self, void *aux)
DPRINTF(("ugensa: in=%#x out=%#x\n", ucaa.ucaa_bulkin,
ucaa.ucaa_bulkout));
- sc->sc_subdev = config_found_sm_loc(self, "ucombus", NULL, &ucaa,
- ucomprint, ucomsubmatch);
+ sc->sc_subdev = config_found(self, &ucaa, ucomprint,
+ CFARG_SUBMATCH, ucomsubmatch,
+ CFARG_EOL);
if (!pmf_device_register(self, NULL, NULL))
aprint_error_dev(self, "couldn't establish power handler\n");
diff --git a/sys/dev/usb/uhidev.c b/sys/dev/usb/uhidev.c
index 854e1fdee9f..74f73c5ab4a 100644
--- a/sys/dev/usb/uhidev.c
+++ b/sys/dev/usb/uhidev.c
@@ -1,4 +1,4 @@
-/* $NetBSD: uhidev.c,v 1.79 2020/11/29 22:54:51 riastradh Exp $ */
+/* $NetBSD: uhidev.c,v 1.80 2021/04/24 23:36:59 thorpej Exp $ */
/*
* Copyright (c) 2001, 2012 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uhidev.c,v 1.79 2020/11/29 22:54:51 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uhidev.c,v 1.80 2021/04/24 23:36:59 thorpej Exp $");
#ifdef _KERNEL_OPT
#include "opt_usb.h"
@@ -361,9 +361,10 @@ uhidev_attach(device_t parent, device_t self, void *aux)
uha.reportid = repid;
locs[UHIDBUSCF_REPORTID] = repid;
- dev = config_found_sm_loc(self,
- "uhidbus", locs, &uha,
- uhidevprint, config_stdsubmatch);
+ dev = config_found(self, &uha, uhidevprint,
+ CFARG_SUBMATCH, config_stdsubmatch,
+ CFARG_LOCATORS, locs,
+ CFARG_EOL);
sc->sc_subdevs[repid] = dev;
if (dev != NULL) {
csc = device_private(dev);
diff --git a/sys/dev/usb/uhmodem.c b/sys/dev/usb/uhmodem.c
index efd4627ec98..38cf4eec293 100644
--- a/sys/dev/usb/uhmodem.c
+++ b/sys/dev/usb/uhmodem.c
@@ -1,4 +1,4 @@
-/* $NetBSD: uhmodem.c,v 1.22 2020/03/13 18:17:41 christos Exp $ */
+/* $NetBSD: uhmodem.c,v 1.23 2021/04/24 23:36:59 thorpej Exp $ */
/*
* Copyright (c) 2008 Yojiro UO <yuo@nui.org>.
@@ -71,7 +71,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uhmodem.c,v 1.22 2020/03/13 18:17:41 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uhmodem.c,v 1.23 2021/04/24 23:36:59 thorpej Exp $");
#ifdef _KERNEL_OPT
#include "opt_usb.h"
@@ -351,8 +351,9 @@ uhmodem_attach(device_t parent, device_t self, void *aux)
DPRINTF(("uhmodem: int#=%d, in = %#x, out = %#x, intr = %#x\n",
i, ucaa.ucaa_bulkin, ucaa.ucaa_bulkout,
sc->sc_intr_number));
- sc->sc_subdevs[i] = config_found_sm_loc(self, "ucombus", NULL,
- &ucaa, ucomprint, ucomsubmatch);
+ sc->sc_subdevs[i] = config_found(self, &ucaa, ucomprint,
+ CFARG_SUBMATCH, ucomsubmatch,
+ CFARG_EOL);
/* issue endpoint halt to each interface */
err = uhmodem_endpointhalt(sc, i);
diff --git a/sys/dev/usb/uipaq.c b/sys/dev/usb/uipaq.c
index edb6e487c24..4d0de6808cb 100644
--- a/sys/dev/usb/uipaq.c
+++ b/sys/dev/usb/uipaq.c
@@ -1,4 +1,4 @@
-/* $NetBSD: uipaq.c,v 1.28 2020/03/13 18:17:41 christos Exp $ */
+/* $NetBSD: uipaq.c,v 1.29 2021/04/24 23:36:59 thorpej Exp $ */
/* $OpenBSD: uipaq.c,v 1.1 2005/06/17 23:50:33 deraadt Exp $ */
/*
@@ -42,7 +42,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uipaq.c,v 1.28 2020/03/13 18:17:41 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipaq.c,v 1.29 2021/04/24 23:36:59 thorpej Exp $");
#ifdef _KERNEL_OPT
#include "opt_usb.h"
@@ -237,8 +237,9 @@ uipaq_attach(device_t parent, device_t self, void *aux)
return;
}
- sc->sc_subdev = config_found_sm_loc(self, "ucombus", NULL, &ucaa,
- ucomprint, ucomsubmatch);
+ sc->sc_subdev = config_found(self, &ucaa, ucomprint,
+ CFARG_SUBMATCH, ucomsubmatch,
+ CFARG_EOL);
return;
diff --git a/sys/dev/usb/uirda.c b/sys/dev/usb/uirda.c
index 291480fa519..f16926a247f 100644
--- a/sys/dev/usb/uirda.c
+++ b/sys/dev/usb/uirda.c
@@ -1,4 +1,4 @@
-/* $NetBSD: uirda.c,v 1.48 2020/12/18 01:40:20 thorpej Exp $ */
+/* $NetBSD: uirda.c,v 1.49 2021/04/24 23:36:59 thorpej Exp $ */
/*
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uirda.c,v 1.48 2020/12/18 01:40:20 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uirda.c,v 1.49 2021/04/24 23:36:59 thorpej Exp $");
#ifdef _KERNEL_OPT
#include "opt_usb.h"
@@ -289,7 +289,7 @@ uirda_attach(device_t parent, device_t self, void *aux)
ia.ia_methods = sc->sc_irm ? sc->sc_irm : &uirda_methods;
ia.ia_handle = sc;
- sc->sc_child = config_found(self, &ia, ir_print);
+ sc->sc_child = config_found(self, &ia, ir_print, CFARG_EOL);
return;
}
diff --git a/sys/dev/usb/ukbd.c b/sys/dev/usb/ukbd.c
index 166c8527334..741b61ae3e9 100644
--- a/sys/dev/usb/ukbd.c
+++ b/sys/dev/usb/ukbd.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ukbd.c,v 1.149 2021/03/02 00:18:22 gdt Exp $ */
+/* $NetBSD: ukbd.c,v 1.150 2021/04/24 23:36:59 thorpej Exp $ */
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ukbd.c,v 1.149 2021/03/02 00:18:22 gdt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ukbd.c,v 1.150 2021/04/24 23:36:59 thorpej Exp $");
#ifdef _KERNEL_OPT
#include "opt_ddb.h"
@@ -488,7 +488,7 @@ ukbd_attach(device_t parent, device_t self, void *aux)
usbd_delay_ms(uha->parent->sc_udev, 400);
ukbd_set_leds(sc, 0);
- sc->sc_wskbddev = config_found(self, &a, wskbddevprint);
+ sc->sc_wskbddev = config_found(self, &a, wskbddevprint, CFARG_EOL);
return;
}
diff --git a/sys/dev/usb/umass_scsipi.c b/sys/dev/usb/umass_scsipi.c
index 81a783d5478..1b14591d0e6 100644
--- a/sys/dev/usb/umass_scsipi.c
+++ b/sys/dev/usb/umass_scsipi.c
@@ -1,4 +1,4 @@
-/* $NetBSD: umass_scsipi.c,v 1.66 2020/03/14 02:35:33 christos Exp $ */
+/* $NetBSD: umass_scsipi.c,v 1.67 2021/04/24 23:36:59 thorpej Exp $ */
/*
* Copyright (c) 2001, 2003, 2012 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: umass_scsipi.c,v 1.66 2020/03/14 02:35:33 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: umass_scsipi.c,v 1.67 2021/04/24 23:36:59 thorpej Exp $");
#ifdef _KERNEL_OPT
#include "opt_usb.h"
@@ -141,8 +141,9 @@ umass_scsi_attach(struct umass_softc *sc)
sc->sc_refcnt++;
mutex_exit(&sc->sc_lock);
scbus->base.sc_child =
- config_found_ia(sc->sc_dev, "scsi", &scbus->sc_channel,
- scsiprint);
+ config_found(sc->sc_dev, &scbus->sc_channel, scsiprint,
+ CFARG_IATTR, "scsi",
+ CFARG_EOL);
mutex_enter(&sc->sc_lock);
if (--sc->sc_refcnt < 0)
cv_broadcast(&sc->sc_detach_cv);
@@ -183,8 +184,9 @@ umass_atapi_attach(struct umass_softc *sc)
sc->sc_refcnt++;
mutex_exit(&sc->sc_lock);
scbus->base.sc_child =
- config_found_ia(sc->sc_dev, "atapi", &scbus->sc_channel,
- atapiprint);
+ config_found(sc->sc_dev, &scbus->sc_channel, atapiprint,
+ CFARG_IATTR, "atapi",
+ CFARG_EOL);
mutex_enter(&sc->sc_lock);
if (--sc->sc_refcnt < 0)
cv_broadcast(&sc->sc_detach_cv);
diff --git a/sys/dev/usb/umcs.c b/sys/dev/usb/umcs.c
index a8694a64029..b61ad34e52f 100644
--- a/sys/dev/usb/umcs.c
+++ b/sys/dev/usb/umcs.c
@@ -1,4 +1,4 @@
-/* $NetBSD: umcs.c,v 1.15 2020/01/07 06:42:26 maxv Exp $ */
+/* $NetBSD: umcs.c,v 1.16 2021/04/24 23:36:59 thorpej Exp $ */
/* $FreeBSD: head/sys/dev/usb/serial/umcs.c 260559 2014-01-12 11:44:28Z hselasky $ */
/*-
@@ -41,7 +41,7 @@
*
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: umcs.c,v 1.15 2020/01/07 06:42:26 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: umcs.c,v 1.16 2021/04/24 23:36:59 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -340,8 +340,9 @@ umcs7840_attach(device_t parent, device_t self, void *aux)
sc->sc_ports[i].sc_port_phys = phyport;
sc->sc_ports[i].sc_port_ucom =
- config_found_sm_loc(self, "ucombus", NULL, &ucaa,
- ucomprint, ucomsubmatch);
+ config_found(self, &ucaa, ucomprint,
+ CFARG_SUBMATCH, ucomsubmatch,
+ CFARG_EOL);
}
}
diff --git a/sys/dev/usb/umct.c b/sys/dev/usb/umct.c
index 4b01ea6e538..bc2e0040568 100644
--- a/sys/dev/usb/umct.c
+++ b/sys/dev/usb/umct.c
@@ -1,4 +1,4 @@
-/* $NetBSD: umct.c,v 1.41 2020/03/13 18:17:41 christos Exp $ */
+/* $NetBSD: umct.c,v 1.42 2021/04/24 23:36:59 thorpej Exp $ */
/*
* Copyright (c) 2001 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: umct.c,v 1.41 2020/03/13 18:17:41 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: umct.c,v 1.42 2021/04/24 23:36:59 thorpej Exp $");
#ifdef _KERNEL_OPT
#include "opt_usb.h"
@@ -301,8 +301,9 @@ umct_attach(device_t parent, device_t self, void *aux)
DPRINTF(("umct: in=%#x out=%#x intr=%#x\n",
ucaa.ucaa_bulkin, ucaa.ucaa_bulkout, sc->sc_intr_number));
- sc->sc_subdev = config_found_sm_loc(self, "ucombus", NULL, &ucaa,
- ucomprint, ucomsubmatch);
+ sc->sc_subdev = config_found(self, &ucaa, ucomprint,
+ CFARG_SUBMATCH, ucomsubmatch,
+ CFARG_EOL);
return;
}
diff --git a/sys/dev/usb/umodem_common.c b/sys/dev/usb/umodem_common.c
index 6c4f724c47d..c0c968cb096 100644
--- a/sys/dev/usb/umodem_common.c
+++ b/sys/dev/usb/umodem_common.c
@@ -1,4 +1,4 @@
-/* $NetBSD: umodem_common.c,v 1.33 2020/04/12 01:10:54 simonb Exp $ */
+/* $NetBSD: umodem_common.c,v 1.34 2021/04/24 23:36:59 thorpej Exp $ */
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -44,7 +44,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: umodem_common.c,v 1.33 2020/04/12 01:10:54 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: umodem_common.c,v 1.34 2021/04/24 23:36:59 thorpej Exp $");
#ifdef _KERNEL_OPT
#include "opt_usb.h"
@@ -263,8 +263,9 @@ umodem_common_attach(device_t self, struct umodem_softc *sc,
usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->sc_udev, sc->sc_dev);
DPRINTF(("umodem_common_attach: sc=%p\n", sc));
- sc->sc_subdev = config_found_sm_loc(self, "ucombus", NULL, ucaa,
- ucomprint, ucomsubmatch);
+ sc->sc_subdev = config_found(self, ucaa, ucomprint,
+ CFARG_SUBMATCH, ucomsubmatch,
+ CFARG_EOL);
return 0;
diff --git a/sys/dev/usb/uplcom.c b/sys/dev/usb/uplcom.c
index 5603de65316..0453aabeae8 100644
--- a/sys/dev/usb/uplcom.c
+++ b/sys/dev/usb/uplcom.c
@@ -1,4 +1,4 @@
-/* $NetBSD: uplcom.c,v 1.89 2020/03/14 03:01:36 christos Exp $ */
+/* $NetBSD: uplcom.c,v 1.90 2021/04/24 23:36:59 thorpej Exp $ */
/*
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uplcom.c,v 1.89 2020/03/14 03:01:36 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uplcom.c,v 1.90 2021/04/24 23:36:59 thorpej Exp $");
#ifdef _KERNEL_OPT
#include "opt_usb.h"
@@ -455,8 +455,9 @@ uplcom_attach(device_t parent, device_t self, void *aux)
DPRINTF("in=%#jx out=%#jx intr=%#jx",
ucaa.ucaa_bulkin, ucaa.ucaa_bulkout, sc->sc_intr_number, 0);
- sc->sc_subdev = config_found_sm_loc(self, "ucombus", NULL, &ucaa,
- ucomprint, ucomsubmatch);
+ sc->sc_subdev = config_found(self, &ucaa, ucomprint,
+ CFARG_SUBMATCH, ucomsubmatch,
+ CFARG_EOL);
if (!pmf_device_register(self, NULL, NULL))
aprint_error_dev(self, "couldn't establish power handler\n");
diff --git a/sys/dev/usb/usb_subr.c b/sys/dev/usb/usb_subr.c
index d4f1de80559..a2cb0818d2a 100644
--- a/sys/dev/usb/usb_subr.c
+++ b/sys/dev/usb/usb_subr.c
@@ -1,4 +1,4 @@
-/* $NetBSD: usb_subr.c,v 1.249 2021/02/17 06:30:57 mlelstv Exp $ */
+/* $NetBSD: usb_subr.c,v 1.250 2021/04/24 23:36:59 thorpej Exp $ */
/* $FreeBSD: src/sys/dev/usb/usb_subr.c,v 1.18 1999/11/17 22:33:47 n_hibma Exp $ */
/*
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: usb_subr.c,v 1.249 2021/02/17 06:30:57 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usb_subr.c,v 1.250 2021/04/24 23:36:59 thorpej Exp $");
#ifdef _KERNEL_OPT
#include "opt_compat_netbsd.h"
@@ -851,7 +851,9 @@ usbd_attach_roothub(device_t parent, struct usbd_device *dev)
uaa.uaa_proto = dd->bDeviceProtocol;
KERNEL_LOCK(1, curlwp);
- dv = config_found_ia(parent, "usbroothubif", &uaa, 0);
+ dv = config_found(parent, &uaa, NULL,
+ CFARG_IATTR, "usbroothubif",
+ CFARG_EOL);
KERNEL_UNLOCK_ONE(curlwp);
if (dv) {
dev->ud_subdevs = kmem_alloc(sizeof(dv), KM_SLEEP);
@@ -925,8 +927,11 @@ usbd_attachwholedevice(device_t parent, struct usbd_device *dev, int port,
KERNEL_LOCK(1, curlwp);
config_pending_incr(parent);
- dv = config_found_sm_loc(parent, "usbdevif", dlocs, &uaa, usbd_print,
- config_stdsubmatch);
+ dv = config_found(parent, &uaa, usbd_print,
+ CFARG_SUBMATCH, config_stdsubmatch,
+ CFARG_IATTR, "usbdevif",
+ CFARG_LOCATORS, dlocs,
+ CFARG_EOL);
KERNEL_UNLOCK_ONE(curlwp);
if (dv) {
dev->ud_subdevs = kmem_alloc(sizeof(dv), KM_SLEEP);
@@ -1003,8 +1008,11 @@ usbd_attachinterfaces(device_t parent, struct usbd_device *dev,
continue;
}
KERNEL_LOCK(1, curlwp);
- dv = config_found_sm_loc(parent, "usbifif", ilocs, &uiaa,
- usbd_ifprint, config_stdsubmatch);
+ dv = config_found(parent, &uiaa, usbd_ifprint,
+ CFARG_SUBMATCH, config_stdsubmatch,
+ CFARG_IATTR, "usbifif",
+ CFARG_LOCATORS, ilocs,
+ CFARG_EOL);
KERNEL_UNLOCK_ONE(curlwp);
if (!dv)
continue;
diff --git a/sys/dev/usb/uslsa.c b/sys/dev/usb/uslsa.c
index db092500786..c85e328ece1 100644
--- a/sys/dev/usb/uslsa.c
+++ b/sys/dev/usb/uslsa.c
@@ -1,4 +1,4 @@
-/* $NetBSD: uslsa.c,v 1.29 2020/03/13 18:17:41 christos Exp $ */
+/* $NetBSD: uslsa.c,v 1.30 2021/04/24 23:36:59 thorpej Exp $ */
/* from ugensa.c */
@@ -58,7 +58,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uslsa.c,v 1.29 2020/03/13 18:17:41 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uslsa.c,v 1.30 2021/04/24 23:36:59 thorpej Exp $");
#ifdef _KERNEL_OPT
#include "opt_usb.h"
@@ -236,8 +236,9 @@ uslsa_attach(device_t parent, device_t self, void *aux)
return;
}
- sc->sc_subdev = config_found_sm_loc(self, "ucombus", NULL, &ucaa,
- ucomprint, ucomsubmatch);
+ sc->sc_subdev = config_found(self, &ucaa, ucomprint,
+ CFARG_SUBMATCH, ucomsubmatch,
+ CFARG_EOL);
if (!pmf_device_register(self, NULL, NULL))
aprint_error_dev(self, "couldn't establish power handler\n");
diff --git a/sys/dev/usb/usscanner.c b/sys/dev/usb/usscanner.c
index 88c8f35171a..c4cc42e2d8a 100644
--- a/sys/dev/usb/usscanner.c
+++ b/sys/dev/usb/usscanner.c
@@ -1,4 +1,4 @@
-/* $NetBSD: usscanner.c,v 1.48 2020/03/14 02:35:33 christos Exp $ */
+/* $NetBSD: usscanner.c,v 1.49 2021/04/24 23:36:59 thorpej Exp $ */
/*
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -47,7 +47,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: usscanner.c,v 1.48 2020/03/14 02:35:33 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usscanner.c,v 1.49 2021/04/24 23:36:59 thorpej Exp $");
#ifdef _KERNEL_OPT
#include "opt_usb.h"
@@ -331,7 +331,8 @@ usscanner_attach(device_t parent, device_t self, void *aux)
usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->sc_udev, sc->sc_dev);
- sc->sc_child = config_found(sc->sc_dev, &sc->sc_channel, scsiprint);
+ sc->sc_child = config_found(sc->sc_dev, &sc->sc_channel, scsiprint,
+ CFARG_EOL);
DPRINTFN(10, ("usscanner_attach: %p\n", sc->sc_udev));
diff --git a/sys/dev/usb/ustir.c b/sys/dev/usb/ustir.c
index 4f42a1ece5c..a33bff5f7c8 100644
--- a/sys/dev/usb/ustir.c
+++ b/sys/dev/usb/ustir.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ustir.c,v 1.47 2020/12/18 01:40:20 thorpej Exp $ */
+/* $NetBSD: ustir.c,v 1.48 2021/04/24 23:36:59 thorpej Exp $ */
/*
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ustir.c,v 1.47 2020/12/18 01:40:20 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ustir.c,v 1.48 2021/04/24 23:36:59 thorpej Exp $");
#ifdef _KERNEL_OPT
#include "opt_usb.h"
@@ -303,7 +303,7 @@ ustir_attach(device_t parent, device_t self, void *aux)
ia.ia_methods = &ustir_methods;
ia.ia_handle = sc;
- sc->sc_child = config_found(self, &ia, ir_print);
+ sc->sc_child = config_found(self, &ia, ir_print, CFARG_EOL);
selinit(&sc->sc_rd_sel);
selinit(&sc->sc_wr_sel);
sc->sc_init_state = USTIR_INIT_INITED;
diff --git a/sys/dev/usb/uts.c b/sys/dev/usb/uts.c
index 120e4e7e8d4..330996fb927 100644
--- a/sys/dev/usb/uts.c
+++ b/sys/dev/usb/uts.c
@@ -1,4 +1,4 @@
-/* $NetBSD: uts.c,v 1.12 2020/03/14 02:35:34 christos Exp $ */
+/* $NetBSD: uts.c,v 1.13 2021/04/24 23:36:59 thorpej Exp $ */
/*
* Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uts.c,v 1.12 2020/03/14 02:35:34 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uts.c,v 1.13 2021/04/24 23:36:59 thorpej Exp $");
#ifdef _KERNEL_OPT
#include "opt_usb.h"
@@ -235,7 +235,7 @@ uts_attach(device_t parent, device_t self, void *aux)
a.accessops = &uts_accessops;
a.accesscookie = sc;
- sc->sc_wsmousedev = config_found(self, &a, wsmousedevprint);
+ sc->sc_wsmousedev = config_found(self, &a, wsmousedevprint, CFARG_EOL);
/* calibrate the touchscreen */
memset(&sc->sc_calibcoords, 0, sizeof(sc->sc_calibcoords));
diff --git a/sys/dev/usb/uvisor.c b/sys/dev/usb/uvisor.c
index 7256fe22fbe..24943e2987d 100644
--- a/sys/dev/usb/uvisor.c
+++ b/sys/dev/usb/uvisor.c
@@ -1,4 +1,4 @@
-/* $NetBSD: uvisor.c,v 1.55 2020/03/13 18:17:41 christos Exp $ */
+/* $NetBSD: uvisor.c,v 1.56 2021/04/24 23:36:59 thorpej Exp $ */
/*
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvisor.c,v 1.55 2020/03/13 18:17:41 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvisor.c,v 1.56 2021/04/24 23:36:59 thorpej Exp $");
#ifdef _KERNEL_OPT
#include "opt_usb.h"
@@ -326,9 +326,10 @@ uvisor_attach(device_t parent, device_t self, void *aux)
}
}
if (hasin == 1 && hasout == 1)
- sc->sc_subdevs[i] = config_found_sm_loc(self,
- "ucombus", NULL, &ucaa,
- ucomprint, ucomsubmatch);
+ sc->sc_subdevs[i] =
+ config_found(self, &ucaa, ucomprint,
+ CFARG_SUBMATCH, ucomsubmatch,
+ CFARG_EOL);
else
aprint_error_dev(self,
"no proper endpoints for port %d (%d,%d)\n",
@@ -358,10 +359,10 @@ uvisor_attach(device_t parent, device_t self, void *aux)
ucaa.ucaa_bulkin = port | UE_DIR_IN;
ucaa.ucaa_bulkout = port | UE_DIR_OUT;
}
- sc->sc_subdevs[i] = config_found_sm_loc(self, "ucombus",
- NULL, &ucaa, ucomprint, ucomsubmatch);
-
-
+ sc->sc_subdevs[i] =
+ config_found(self, &ucaa, ucomprint,
+ CFARG_SUBMATCH, ucomsubmatch,
+ CFARG_EOL);
}
}
diff --git a/sys/dev/usb/uvscom.c b/sys/dev/usb/uvscom.c
index ed2595c9659..073d701a329 100644
--- a/sys/dev/usb/uvscom.c
+++ b/sys/dev/usb/uvscom.c
@@ -1,4 +1,4 @@
-/* $NetBSD: uvscom.c,v 1.37 2020/03/13 18:17:41 christos Exp $ */
+/* $NetBSD: uvscom.c,v 1.38 2021/04/24 23:36:59 thorpej Exp $ */
/*-
* Copyright (c) 2001-2002, Shunsuke Akiyama <akiyama@jp.FreeBSD.org>.
* All rights reserved.
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvscom.c,v 1.37 2020/03/13 18:17:41 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvscom.c,v 1.38 2021/04/24 23:36:59 thorpej Exp $");
#ifdef _KERNEL_OPT
#include "opt_usb.h"
@@ -361,8 +361,9 @@ uvscom_attach(device_t parent, device_t self, void *aux)
DPRINTF(("uplcom: in=%#x out=%#x intr=%#x\n",
ucaa.ucaa_bulkin, ucaa.ucaa_bulkout, sc->sc_intr_number ));
- sc->sc_subdev = config_found_sm_loc(self, "ucombus", NULL, &ucaa,
- ucomprint, ucomsubmatch);
+ sc->sc_subdev = config_found(self, &ucaa, ucomprint,
+ CFARG_SUBMATCH, ucomsubmatch,
+ CFARG_EOL);
return;
}
diff --git a/sys/dev/usb/vhci.c b/sys/dev/usb/vhci.c
index 7e1350152cc..b5c85845888 100644
--- a/sys/dev/usb/vhci.c
+++ b/sys/dev/usb/vhci.c
@@ -1,4 +1,4 @@
-/* $NetBSD: vhci.c,v 1.20 2020/06/05 17:20:56 maxv Exp $ */
+/* $NetBSD: vhci.c,v 1.21 2021/04/24 23:36:59 thorpej Exp $ */
/*
* Copyright (c) 2019-2020 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vhci.c,v 1.20 2020/06/05 17:20:56 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vhci.c,v 1.21 2021/04/24 23:36:59 thorpej Exp $");
#ifdef _KERNEL_OPT
#include "opt_usb.h"
@@ -1319,5 +1319,5 @@ vhci_attach(device_t parent, device_t self, void *aux)
KCOV_REMOTE_VHCI_ID(sc->sc_bus.ub_busnum, i));
}
- sc->sc_child = config_found(self, &sc->sc_bus, usbctlprint);
+ sc->sc_child = config_found(self, &sc->sc_bus, usbctlprint, CFARG_EOL);
}