From 778e5b6687a9e696ba2a5ab498feca65c0fc19ba Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Wed, 13 Jun 2007 05:37:59 +0000 Subject: [PATCH] Expand USB_DETACH, USB_ATTACH and USB_MATCH inline. No functional change, and MD5's appear to be the same. --- sys/dev/usb/if_aue.c | 6 ++++-- sys/dev/usb/if_axe.c | 6 ++++-- sys/dev/usb/if_cdce.c | 9 ++++++--- sys/dev/usb/if_cue.c | 6 ++++-- sys/dev/usb/if_kue.c | 6 ++++-- sys/dev/usb/if_rue.c | 6 ++++-- sys/dev/usb/if_rum.c | 9 ++++++--- sys/dev/usb/if_udav.c | 9 ++++++--- sys/dev/usb/if_ural.c | 9 ++++++--- sys/dev/usb/ubsa.c | 9 ++++++--- sys/dev/usb/ubser.c | 9 ++++++--- sys/dev/usb/udbp.c | 9 ++++++--- sys/dev/usb/ufm.c | 6 ++++-- sys/dev/usb/ufoma.c | 9 ++++++--- sys/dev/usb/uftdi.c | 9 ++++++--- sys/dev/usb/uhid.c | 9 ++++++--- sys/dev/usb/uhub.c | 6 ++++-- sys/dev/usb/uipaq.c | 3 ++- sys/dev/usb/ukbd.c | 6 ++++-- sys/dev/usb/ulpt.c | 9 ++++++--- sys/dev/usb/umass.c | 9 ++++++--- sys/dev/usb/umct.c | 9 ++++++--- sys/dev/usb/umodem.c | 9 ++++++--- sys/dev/usb/ums.c | 6 ++++-- sys/dev/usb/uplcom.c | 9 ++++++--- sys/dev/usb/urio.c | 9 ++++++--- sys/dev/usb/usb.c | 9 ++++++--- sys/dev/usb/uscanner.c | 9 ++++++--- sys/dev/usb/uvisor.c | 9 ++++++--- sys/dev/usb/uvscom.c | 9 ++++++--- 30 files changed, 158 insertions(+), 79 deletions(-) diff --git a/sys/dev/usb/if_aue.c b/sys/dev/usb/if_aue.c index 401dd25b09b8..0cfd53a95d12 100644 --- a/sys/dev/usb/if_aue.c +++ b/sys/dev/usb/if_aue.c @@ -612,7 +612,8 @@ aue_reset(struct aue_softc *sc) /* * Probe for a Pegasus chip. */ -USB_MATCH(aue) +static int +aue_match(device_t self) { USB_MATCH_START(aue, uaa); @@ -627,7 +628,8 @@ USB_MATCH(aue) * Attach the interface. Allocate softc structures, do ifmedia * setup and ethernet/BPF attach. */ -USB_ATTACH(aue) +static int +aue_attach(device_t self) { USB_ATTACH_START(aue, sc, uaa); u_char eaddr[ETHER_ADDR_LEN]; diff --git a/sys/dev/usb/if_axe.c b/sys/dev/usb/if_axe.c index ceb5edf72f49..32e609984d6d 100644 --- a/sys/dev/usb/if_axe.c +++ b/sys/dev/usb/if_axe.c @@ -379,7 +379,8 @@ axe_reset(struct axe_softc *sc) /* * Probe for a AX88172 chip. */ -USB_MATCH(axe) +static int +axe_match(device_t self) { USB_MATCH_START(axe, uaa); struct axe_type *t; @@ -403,7 +404,8 @@ USB_MATCH(axe) * Attach the interface. Allocate softc structures, do ifmedia * setup and ethernet/BPF attach. */ -USB_ATTACH(axe) +static int +axe_attach(device_t self) { USB_ATTACH_START(axe, sc, uaa); u_char eaddr[ETHER_ADDR_LEN]; diff --git a/sys/dev/usb/if_cdce.c b/sys/dev/usb/if_cdce.c index de7a0b683cfe..ef8101dc7780 100644 --- a/sys/dev/usb/if_cdce.c +++ b/sys/dev/usb/if_cdce.c @@ -108,7 +108,8 @@ static const struct cdce_type cdce_devs[] = { }; #define cdce_lookup(v, p) ((const struct cdce_type *)usb_lookup(cdce_devs, v, p)) -USB_MATCH(cdce) +static int +cdce_match(device_t self) { USB_MATCH_START(cdce, uaa); usb_interface_descriptor_t *id; @@ -130,7 +131,8 @@ USB_MATCH(cdce) return (UMATCH_NONE); } -USB_ATTACH(cdce) +static int +cdce_attach(device_t self) { USB_ATTACH_START(cdce, sc, uaa); struct ifnet *ifp; @@ -317,7 +319,8 @@ USB_ATTACH(cdce) return 0; } -USB_DETACH(cdce) +static int +cdce_detach(device_t self) { USB_DETACH_START(cdce, sc); struct ifnet *ifp; diff --git a/sys/dev/usb/if_cue.c b/sys/dev/usb/if_cue.c index cefa42f7c3bd..7385a5dfd124 100644 --- a/sys/dev/usb/if_cue.c +++ b/sys/dev/usb/if_cue.c @@ -404,7 +404,8 @@ cue_reset(struct cue_softc *sc) /* * Probe for a Pegasus chip. */ -USB_MATCH(cue) +static int +cue_match(device_t self) { USB_MATCH_START(cue, uaa); struct cue_type *t; @@ -428,7 +429,8 @@ USB_MATCH(cue) * Attach the interface. Allocate softc structures, do ifmedia * setup and ethernet/BPF attach. */ -USB_ATTACH(cue) +static int +cue_attach(device_t self) { USB_ATTACH_START(cue, sc, uaa); u_char eaddr[ETHER_ADDR_LEN]; diff --git a/sys/dev/usb/if_kue.c b/sys/dev/usb/if_kue.c index 3fbe9040c2ec..8cae085981b3 100644 --- a/sys/dev/usb/if_kue.c +++ b/sys/dev/usb/if_kue.c @@ -377,7 +377,8 @@ kue_reset(struct kue_softc *sc) /* * Probe for a KLSI chip. */ -USB_MATCH(kue) +static int +kue_match(device_t self) { USB_MATCH_START(kue, uaa); struct kue_type *t; @@ -401,7 +402,8 @@ USB_MATCH(kue) * Attach the interface. Allocate softc structures, do * setup and ethernet/BPF attach. */ -USB_ATTACH(kue) +static int +kue_attach(device_t self) { USB_ATTACH_START(kue, sc, uaa); struct ifnet *ifp; diff --git a/sys/dev/usb/if_rue.c b/sys/dev/usb/if_rue.c index 3839926d070c..c2c8dd55dc9c 100644 --- a/sys/dev/usb/if_rue.c +++ b/sys/dev/usb/if_rue.c @@ -547,7 +547,8 @@ rue_reset(struct rue_softc *sc) * Probe for a RTL8150 chip. */ -USB_MATCH(rue) +static int +rue_match(device_t self) { USB_MATCH_START(rue, uaa); struct rue_type *t; @@ -572,7 +573,8 @@ USB_MATCH(rue) * setup and ethernet/BPF attach. */ -USB_ATTACH(rue) +static int +rue_attach(device_t self) { USB_ATTACH_START(rue, sc, uaa); u_char eaddr[ETHER_ADDR_LEN]; diff --git a/sys/dev/usb/if_rum.c b/sys/dev/usb/if_rum.c index 2af38f1b7e69..f8161df147af 100644 --- a/sys/dev/usb/if_rum.c +++ b/sys/dev/usb/if_rum.c @@ -359,7 +359,8 @@ static const struct rfprog { USB_DECLARE_DRIVER(rum); -USB_MATCH(rum) +static int +rum_match(device_t self) { USB_MATCH_START(rum, uaa); @@ -370,7 +371,8 @@ USB_MATCH(rum) UMATCH_VENDOR_PRODUCT : UMATCH_NONE; } -USB_ATTACH(rum) +static int +rum_attach(device_t self) { USB_ATTACH_START(rum, sc, uaa); struct ieee80211com *ic = &sc->sc_ic; @@ -568,7 +570,8 @@ USB_ATTACH(rum) return 0; } -USB_DETACH(rum) +static int +rum_detach(device_t self) { USB_DETACH_START(rum, sc); struct ieee80211com *ic = &sc->sc_ic; diff --git a/sys/dev/usb/if_udav.c b/sys/dev/usb/if_udav.c index 093200793842..28059ad51a0a 100644 --- a/sys/dev/usb/if_udav.c +++ b/sys/dev/usb/if_udav.c @@ -264,7 +264,8 @@ static const struct udav_type { /* Probe */ -USB_MATCH(udav) +static int +udav_match(device_t self) { USB_MATCH_START(udav, uaa); @@ -276,7 +277,8 @@ USB_MATCH(udav) } /* Attach */ -USB_ATTACH(udav) +static int +udav_attach(device_t self) { USB_ATTACH_START(udav, sc, uaa); usbd_device_handle dev = uaa->device; @@ -480,7 +482,8 @@ USB_ATTACH(udav) } /* detach */ -USB_DETACH(udav) +static int +udav_detach(device_t self) { USB_DETACH_START(udav, sc); struct ifnet *ifp = GET_IFP(sc); diff --git a/sys/dev/usb/if_ural.c b/sys/dev/usb/if_ural.c index e4d71fb0c4a0..5e28ac722f97 100644 --- a/sys/dev/usb/if_ural.c +++ b/sys/dev/usb/if_ural.c @@ -346,7 +346,8 @@ static const struct { USB_DECLARE_DRIVER(ural); -USB_MATCH(ural) +static int +ural_match(device_t self) { USB_MATCH_START(ural, uaa); @@ -357,7 +358,8 @@ USB_MATCH(ural) UMATCH_VENDOR_PRODUCT : UMATCH_NONE; } -USB_ATTACH(ural) +static int +ural_attach(device_t self) { USB_ATTACH_START(ural, sc, uaa); struct ifnet *ifp; @@ -507,7 +509,8 @@ USB_ATTACH(ural) return 0; } -USB_DETACH(ural) +static int +ural_detach(device_t self) { USB_DETACH_START(ural, sc); struct ieee80211com *ic = &sc->sc_ic; diff --git a/sys/dev/usb/ubsa.c b/sys/dev/usb/ubsa.c index 9e24af2485da..a7e8ee553b7a 100644 --- a/sys/dev/usb/ubsa.c +++ b/sys/dev/usb/ubsa.c @@ -258,7 +258,8 @@ MODULE_DEPEND(ubsa, usb, 1, 1, 1); MODULE_DEPEND(ubsa, ucom, UCOM_MINVER, UCOM_PREFVER, UCOM_MAXVER); MODULE_VERSION(ubsa, UBSA_MODVER); -USB_MATCH(ubsa) +static int +ubsa_match(device_t self) { USB_MATCH_START(ubsa, uaa); int i; @@ -275,7 +276,8 @@ USB_MATCH(ubsa) return (UMATCH_NONE); } -USB_ATTACH(ubsa) +static int +ubsa_attach(device_t self) { USB_ATTACH_START(ubsa, sc, uaa); usbd_device_handle dev; @@ -404,7 +406,8 @@ USB_ATTACH(ubsa) return ENXIO; } -USB_DETACH(ubsa) +static int +ubsa_detach(device_t self) { USB_DETACH_START(ubsa, sc); int rv; diff --git a/sys/dev/usb/ubser.c b/sys/dev/usb/ubser.c index b6b23a23eba5..934a271fac88 100644 --- a/sys/dev/usb/ubser.c +++ b/sys/dev/usb/ubser.c @@ -179,7 +179,8 @@ static t_modem_t ubsermodem; USB_DECLARE_DRIVER(ubser); -USB_MATCH(ubser) +static int +ubser_match(device_t self) { USB_MATCH_START(ubser, uaa); usb_string_descriptor_t us; @@ -218,7 +219,8 @@ USB_MATCH(ubser) return (UMATCH_NONE); } -USB_ATTACH(ubser) +static int +ubser_attach(device_t self) { USB_ATTACH_START(ubser, sc, uaa); usbd_device_handle udev = uaa->device; @@ -411,7 +413,8 @@ USB_ATTACH(ubser) return ENXIO; } -USB_DETACH(ubser) +static int +ubser_detach(device_t self) { USB_DETACH_START(ubser, sc); int i; diff --git a/sys/dev/usb/udbp.c b/sys/dev/usb/udbp.c index a937407c5718..cb40f1dc3251 100644 --- a/sys/dev/usb/udbp.c +++ b/sys/dev/usb/udbp.c @@ -216,7 +216,8 @@ static void udbp_out_transfer_cb (usbd_xfer_handle xfer, USB_DECLARE_DRIVER(udbp); -USB_MATCH(udbp) +static int +udbp_match(device_t self) { USB_MATCH_START(udbp, uaa); usb_interface_descriptor_t *id; @@ -248,7 +249,8 @@ USB_MATCH(udbp) return (UMATCH_NONE); } -USB_ATTACH(udbp) +static int +udbp_attach(device_t self) { USB_ATTACH_START(udbp, sc, uaa); usbd_interface_handle iface = uaa->iface; @@ -404,7 +406,8 @@ USB_ATTACH(udbp) } -USB_DETACH(udbp) +static int +udbp_detach(device_t self) { USB_DETACH_START(udbp, sc); diff --git a/sys/dev/usb/ufm.c b/sys/dev/usb/ufm.c index 152cf6566f5d..0c7c89cc2686 100644 --- a/sys/dev/usb/ufm.c +++ b/sys/dev/usb/ufm.c @@ -100,7 +100,8 @@ struct ufm_softc { USB_DECLARE_DRIVER(ufm); -USB_MATCH(ufm) +static int +ufm_match(device_t self) { USB_MATCH_START(ufm, uaa); usb_device_descriptor_t *dd; @@ -119,7 +120,8 @@ USB_MATCH(ufm) return UMATCH_NONE; } -USB_ATTACH(ufm) +static int +ufm_attach(device_t self) { USB_ATTACH_START(ufm, sc, uaa); usb_endpoint_descriptor_t *edesc; diff --git a/sys/dev/usb/ufoma.c b/sys/dev/usb/ufoma.c index 5cb9ff726cbc..5960d3de47db 100644 --- a/sys/dev/usb/ufoma.c +++ b/sys/dev/usb/ufoma.c @@ -260,7 +260,8 @@ DRIVER_MODULE(ufoma, uhub, ufoma_driver, ucom_devclass, usbd_driver_load, 0); MODULE_DEPEND(ufoma, usb, 1, 1, 1); MODULE_DEPEND(ufoma, ucom, UCOM_MINVER, UCOM_PREFVER, UCOM_MAXVER); -USB_MATCH(ufoma) +static int +ufoma_match(device_t self) { USB_MATCH_START(ufoma, uaa); usb_interface_descriptor_t *id; @@ -298,7 +299,8 @@ USB_MATCH(ufoma) return ret; } -USB_ATTACH(ufoma) +static int +ufoma_attach(device_t self) { USB_ATTACH_START(ufoma, sc, uaa); usbd_device_handle dev = uaa->device; @@ -414,7 +416,8 @@ USB_ATTACH(ufoma) return EIO; } -USB_DETACH(ufoma) +static int +ufoma_detach(device_t self) { USB_DETACH_START(ufoma, sc); int rv = 0; diff --git a/sys/dev/usb/uftdi.c b/sys/dev/usb/uftdi.c index 6592261e24b3..1e1f1fb80d93 100644 --- a/sys/dev/usb/uftdi.c +++ b/sys/dev/usb/uftdi.c @@ -133,7 +133,8 @@ struct ucom_callback uftdi_callback = { uftdi_write, }; -USB_MATCH(uftdi) +static int +uftdi_match(device_t self) { USB_MATCH_START(uftdi, uaa); @@ -183,7 +184,8 @@ USB_MATCH(uftdi) return (UMATCH_NONE); } -USB_ATTACH(uftdi) +static int +uftdi_attach(device_t self) { USB_ATTACH_START(uftdi, sc, uaa); usbd_device_handle dev = uaa->device; @@ -385,7 +387,8 @@ uftdi_activate(device_t self, enum devact act) } #endif #if 1 -USB_DETACH(uftdi) +static int +uftdi_detach(device_t self) { USB_DETACH_START(uftdi, sc); diff --git a/sys/dev/usb/uhid.c b/sys/dev/usb/uhid.c index 7dabdae93677..c0ae88281b95 100644 --- a/sys/dev/usb/uhid.c +++ b/sys/dev/usb/uhid.c @@ -177,7 +177,8 @@ static int uhid_do_ioctl(struct uhid_softc *, u_long, caddr_t, int, USB_DECLARE_DRIVER(uhid); -USB_MATCH(uhid) +static int +uhid_match(device_t self) { USB_MATCH_START(uhid, uaa); usb_interface_descriptor_t *id; @@ -204,7 +205,8 @@ USB_MATCH(uhid) return (UMATCH_IFACECLASS_GENERIC); } -USB_ATTACH(uhid) +static int +uhid_attach(device_t self) { USB_ATTACH_START(uhid, sc, uaa); usbd_interface_handle iface = uaa->iface; @@ -335,7 +337,8 @@ uhid_activate(device_t self, enum devact act) } #endif -USB_DETACH(uhid) +static int +uhid_detach(device_t self) { USB_DETACH_START(uhid, sc); int s; diff --git a/sys/dev/usb/uhub.c b/sys/dev/usb/uhub.c index 79749d57535e..769dd6f10a3f 100644 --- a/sys/dev/usb/uhub.c +++ b/sys/dev/usb/uhub.c @@ -136,7 +136,8 @@ static driver_t uhubroot_driver = { sizeof(struct uhub_softc) }; -USB_MATCH(uhub) +static int +uhub_match(device_t self) { USB_MATCH_START(uhub, uaa); usb_device_descriptor_t *dd = usbd_get_device_descriptor(uaa->device); @@ -534,7 +535,8 @@ uhub_explore(usbd_device_handle dev) * Called from process context when the hub is gone. * Detach all devices on active ports. */ -USB_DETACH(uhub) +static int +uhub_detach(device_t self) { USB_DETACH_START(uhub, sc); struct usbd_hub *hub = sc->sc_hub->hub; diff --git a/sys/dev/usb/uipaq.c b/sys/dev/usb/uipaq.c index 197e24bd6380..2645eef5d50f 100644 --- a/sys/dev/usb/uipaq.c +++ b/sys/dev/usb/uipaq.c @@ -129,7 +129,8 @@ static const struct uipaq_type uipaq_devs[] = { #define uipaq_lookup(v, p) ((const struct uipaq_type *)usb_lookup(uipaq_devs, v, p)) -USB_MATCH(uipaq) +static int +uipaq_match(device_t self) { USB_MATCH_START(uipaq, uaa); diff --git a/sys/dev/usb/ukbd.c b/sys/dev/usb/ukbd.c index d8277406fc6d..cbd536b5d0e0 100644 --- a/sys/dev/usb/ukbd.c +++ b/sys/dev/usb/ukbd.c @@ -126,7 +126,8 @@ static int ukbd_driver_load(module_t mod, int what, void *arg); USB_DECLARE_DRIVER_INIT(ukbd, DEVMETHOD(device_resume, ukbd_resume)); -USB_MATCH(ukbd) +static int +ukbd_match(device_t self) { USB_MATCH_START(ukbd, uaa); @@ -149,7 +150,8 @@ USB_MATCH(ukbd) return (UMATCH_IFACECLASS_IFACESUBCLASS_IFACEPROTO); } -USB_ATTACH(ukbd) +static int +ukbd_attach(device_t self) { USB_ATTACH_START(ukbd, sc, uaa); usbd_interface_handle iface = uaa->iface; diff --git a/sys/dev/usb/ulpt.c b/sys/dev/usb/ulpt.c index 65aaaccb23e4..446dd25c87ca 100644 --- a/sys/dev/usb/ulpt.c +++ b/sys/dev/usb/ulpt.c @@ -167,7 +167,8 @@ void ieee1284_print_id(char *); USB_DECLARE_DRIVER(ulpt); -USB_MATCH(ulpt) +static int +ulpt_match(device_t self) { USB_MATCH_START(ulpt, uaa); usb_interface_descriptor_t *id; @@ -186,7 +187,8 @@ USB_MATCH(ulpt) return (UMATCH_NONE); } -USB_ATTACH(ulpt) +static int +ulpt_attach(device_t self) { USB_ATTACH_START(ulpt, sc, uaa); usbd_device_handle dev = uaa->device; @@ -335,7 +337,8 @@ USB_ATTACH(ulpt) } -USB_DETACH(ulpt) +static int +ulpt_detach(device_t self) { USB_DETACH_START(ulpt, sc); int s; diff --git a/sys/dev/usb/umass.c b/sys/dev/usb/umass.c index 4c2b9b269365..41f59b7ba9be 100644 --- a/sys/dev/usb/umass.c +++ b/sys/dev/usb/umass.c @@ -910,7 +910,8 @@ umass_match_proto(struct umass_softc *sc, usbd_interface_handle iface, return(UMATCH_DEVCLASS_DEVSUBCLASS_DEVPROTO); } -USB_MATCH(umass) +static int +umass_match(device_t self) { USB_MATCH_START(umass, uaa); struct umass_softc *sc = device_get_softc(self); @@ -921,7 +922,8 @@ USB_MATCH(umass) return(umass_match_proto(sc, uaa->iface, uaa->device)); } -USB_ATTACH(umass) +static int +umass_attach(device_t self) { USB_ATTACH_START(umass, sc, uaa); usb_interface_descriptor_t *id; @@ -1175,7 +1177,8 @@ USB_ATTACH(umass) return 0; } -USB_DETACH(umass) +static int +umass_detach(device_t self) { USB_DETACH_START(umass, sc); int err = 0; diff --git a/sys/dev/usb/umct.c b/sys/dev/usb/umct.c index 23ebe4d9cdde..9d890954ed41 100644 --- a/sys/dev/usb/umct.c +++ b/sys/dev/usb/umct.c @@ -138,7 +138,8 @@ MODULE_DEPEND(umct, usb, 1, 1, 1); MODULE_DEPEND(umct, ucom, UCOM_MINVER, UCOM_PREFVER, UCOM_MAXVER); MODULE_VERSION(umct, 1); -USB_MATCH(umct) +static int +umct_match(device_t self) { USB_MATCH_START(umct, uaa); int i; @@ -156,7 +157,8 @@ USB_MATCH(umct) return (UMATCH_NONE); } -USB_ATTACH(umct) +static int +umct_attach(device_t self) { USB_ATTACH_START(umct, sc, uaa); usbd_device_handle dev; @@ -273,7 +275,8 @@ USB_ATTACH(umct) return ENXIO; } -USB_DETACH(umct) +static int +umct_detach(device_t self) { USB_DETACH_START(umct, sc); int rv; diff --git a/sys/dev/usb/umodem.c b/sys/dev/usb/umodem.c index 700df565fe80..b1ee0d6d0e94 100644 --- a/sys/dev/usb/umodem.c +++ b/sys/dev/usb/umodem.c @@ -227,7 +227,8 @@ MODULE_DEPEND(umodem, usb, 1, 1, 1); MODULE_DEPEND(umodem, ucom, UCOM_MINVER, UCOM_PREFVER, UCOM_MAXVER); MODULE_VERSION(umodem, UMODEM_MODVER); -USB_MATCH(umodem) +static int +umodem_match(device_t self) { USB_MATCH_START(umodem, uaa); usb_interface_descriptor_t *id; @@ -270,7 +271,8 @@ USB_MATCH(umodem) return ret; } -USB_ATTACH(umodem) +static int +umodem_attach(device_t self) { USB_ATTACH_START(umodem, sc, uaa); usbd_device_handle dev = uaa->device; @@ -804,7 +806,8 @@ umodem_set_comm_feature(struct umodem_softc *sc, int feature, int state) return (USBD_NORMAL_COMPLETION); } -USB_DETACH(umodem) +static int +umodem_detach(device_t self) { USB_DETACH_START(umodem, sc); int rv = 0; diff --git a/sys/dev/usb/ums.c b/sys/dev/usb/ums.c index b248eb9cc068..c8fdb99d7255 100644 --- a/sys/dev/usb/ums.c +++ b/sys/dev/usb/ums.c @@ -159,7 +159,8 @@ static struct cdevsw ums_cdevsw = { USB_DECLARE_DRIVER(ums); -USB_MATCH(ums) +static int +ums_match(device_t self) { USB_MATCH_START(ums, uaa); usb_interface_descriptor_t *id; @@ -187,7 +188,8 @@ USB_MATCH(ums) return (ret); } -USB_ATTACH(ums) +static int +ums_attach(device_t self) { USB_ATTACH_START(ums, sc, uaa); usbd_interface_handle iface = uaa->iface; diff --git a/sys/dev/usb/uplcom.c b/sys/dev/usb/uplcom.c index af0df4329169..5a564e617a9f 100644 --- a/sys/dev/usb/uplcom.c +++ b/sys/dev/usb/uplcom.c @@ -318,7 +318,8 @@ SYSCTL_PROC(_hw_usb_uplcom, OID_AUTO, interval, CTLTYPE_INT | CTLFLAG_RW, 0, sizeof(int), sysctl_hw_usb_uplcom_interval, "I", "uplcom interrupt pipe interval"); -USB_MATCH(uplcom) +static int +uplcom_match(device_t self) { USB_MATCH_START(uplcom, uaa); int i; @@ -337,7 +338,8 @@ USB_MATCH(uplcom) return (UMATCH_NONE); } -USB_ATTACH(uplcom) +static int +uplcom_attach(device_t self) { USB_ATTACH_START(uplcom, sc, uaa); usbd_device_handle dev = uaa->device; @@ -544,7 +546,8 @@ USB_ATTACH(uplcom) return ENXIO; } -USB_DETACH(uplcom) +static int +uplcom_detach(device_t self) { USB_DETACH_START(uplcom, sc); int rv = 0; diff --git a/sys/dev/usb/urio.c b/sys/dev/usb/urio.c index 3293dd4c3eac..5f86d9a0398d 100644 --- a/sys/dev/usb/urio.c +++ b/sys/dev/usb/urio.c @@ -154,7 +154,8 @@ struct urio_softc { USB_DECLARE_DRIVER(urio); -USB_MATCH(urio) +static int +urio_match(device_t self) { USB_MATCH_START(urio, uaa); usb_device_descriptor_t *dd; @@ -176,7 +177,8 @@ USB_MATCH(urio) return UMATCH_NONE; } -USB_ATTACH(urio) +static int +urio_attach(device_t self) { USB_ATTACH_START(urio, sc, uaa); usbd_device_handle udev; @@ -592,7 +594,8 @@ urio_activate(device_t self, enum devact act) return (0); } -USB_DETACH(urio) +static int +urio_detach(device_t self) { USB_DETACH_START(urio, sc); struct urio_endpoint *sce; diff --git a/sys/dev/usb/usb.c b/sys/dev/usb/usb.c index debe752c93ba..fb3e9f82a113 100644 --- a/sys/dev/usb/usb.c +++ b/sys/dev/usb/usb.c @@ -190,13 +190,15 @@ USB_DECLARE_DRIVER_INIT(usb, MODULE_VERSION(usb, 1); -USB_MATCH(usb) +static int +usb_match(device_t self) { DPRINTF(("usbd_match\n")); return (UMATCH_GENERIC); } -USB_ATTACH(usb) +static int +usb_attach(device_t self) { struct usb_softc *sc = device_get_softc(self); void *aux = device_get_ivars(self); @@ -821,7 +823,8 @@ usb_schedsoftintr(usbd_bus_handle bus) #endif /* USB_USE_SOFTINTR */ } -USB_DETACH(usb) +static int +usb_detach(device_t self) { USB_DETACH_START(usb, sc); struct usb_event ue; diff --git a/sys/dev/usb/uscanner.c b/sys/dev/usb/uscanner.c index 5e7257804e72..a3ef76158008 100644 --- a/sys/dev/usb/uscanner.c +++ b/sys/dev/usb/uscanner.c @@ -300,7 +300,8 @@ static void uscanner_do_close(struct uscanner_softc *); USB_DECLARE_DRIVER(uscanner); -USB_MATCH(uscanner) +static int +uscanner_match(device_t self) { USB_MATCH_START(uscanner, uaa); @@ -311,7 +312,8 @@ USB_MATCH(uscanner) UMATCH_VENDOR_PRODUCT : UMATCH_NONE); } -USB_ATTACH(uscanner) +static int +uscanner_attach(device_t self) { USB_ATTACH_START(uscanner, sc, uaa); usb_interface_descriptor_t *id = 0; @@ -626,7 +628,8 @@ uscanner_activate(device_t self, enum devact act) } #endif -USB_DETACH(uscanner) +static int +uscanner_detach(device_t self) { USB_DETACH_START(uscanner, sc); int s; diff --git a/sys/dev/usb/uvisor.c b/sys/dev/usb/uvisor.c index 8552e27169ca..dbcb315a7afb 100644 --- a/sys/dev/usb/uvisor.c +++ b/sys/dev/usb/uvisor.c @@ -244,7 +244,8 @@ static const struct uvisor_type uvisor_devs[] = { #define uvisor_lookup(v, p) ((const struct uvisor_type *)usb_lookup(uvisor_devs, v, p)) -USB_MATCH(uvisor) +static int +uvisor_match(device_t self) { USB_MATCH_START(uvisor, uaa); @@ -258,7 +259,8 @@ USB_MATCH(uvisor) UMATCH_VENDOR_PRODUCT : UMATCH_NONE); } -USB_ATTACH(uvisor) +static int +uvisor_attach(device_t self) { USB_ATTACH_START(uvisor, sc, uaa); usbd_device_handle dev = uaa->device; @@ -395,7 +397,8 @@ uvisor_activate(device_t self, enum devact act) #endif -USB_DETACH(uvisor) +static int +uvisor_detach(device_t self) { USB_DETACH_START(uvisor, sc); int rv = 0; diff --git a/sys/dev/usb/uvscom.c b/sys/dev/usb/uvscom.c index 7a6b24105f6b..97ced912d4c1 100644 --- a/sys/dev/usb/uvscom.c +++ b/sys/dev/usb/uvscom.c @@ -294,7 +294,8 @@ SYSCTL_PROC(_hw_usb_uvscom, OID_AUTO, interval, CTLTYPE_INT | CTLFLAG_RW, 0, sizeof(int), sysctl_hw_usb_uvscom_interval, "I", "uvscom interrpt pipe interval"); -USB_MATCH(uvscom) +static int +uvscom_match(device_t self) { USB_MATCH_START(uvscom, uaa); @@ -305,7 +306,8 @@ USB_MATCH(uvscom) UMATCH_VENDOR_PRODUCT : UMATCH_NONE); } -USB_ATTACH(uvscom) +static int +uvscom_attach(device_t self) { USB_ATTACH_START(uvscom, sc, uaa); usbd_device_handle dev = uaa->device; @@ -430,7 +432,8 @@ USB_ATTACH(uvscom) return ENXIO; } -USB_DETACH(uvscom) +static int +uvscom_detach(device_t self) { USB_DETACH_START(uvscom, sc); int rv = 0;