summaryrefslogtreecommitdiff
path: root/sys/dev/usb/if_udav.c
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2007-05-27 04:00:26 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2007-05-27 04:00:26 +0000
commit8af8360c45b95e6b193754943c92302b8b294a5f (patch)
treea6019b8f5be3c6276cfe93066c6277c7a5b877fe /sys/dev/usb/if_udav.c
parent86426f8d732cd6e237f154fe80a9dd0ca0c2a8aa (diff)
Farewell USB_{ATTACH,MATCH,DETACH}* you will not be missed.
ok deraadt@ krw@ mbalmer@
Diffstat (limited to 'sys/dev/usb/if_udav.c')
-rw-r--r--sys/dev/usb/if_udav.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/sys/dev/usb/if_udav.c b/sys/dev/usb/if_udav.c
index 2b3e50cd865..a70d6626bb5 100644
--- a/sys/dev/usb/if_udav.c
+++ b/sys/dev/usb/if_udav.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_udav.c,v 1.24 2007/05/21 05:40:27 jsg Exp $ */
+/* $OpenBSD: if_udav.c,v 1.25 2007/05/27 04:00:25 jsg Exp $ */
/* $NetBSD: if_udav.c,v 1.3 2004/04/23 17:25:25 itojun Exp $ */
/* $nabe: if_udav.c,v 1.3 2003/08/21 16:57:19 nabe Exp $ */
/*
@@ -156,9 +156,10 @@ static const struct udav_type {
/* Probe */
-USB_MATCH(udav)
+int
+udav_match(struct device *parent, void *match, void *aux)
{
- USB_MATCH_START(udav, uaa);
+ struct usb_attach_arg *uaa = aux;
if (uaa->iface != NULL)
return (UMATCH_NONE);
@@ -168,9 +169,11 @@ USB_MATCH(udav)
}
/* Attach */
-USB_ATTACH(udav)
+void
+udav_attach(struct device *parent, struct device *self, void *aux)
{
- USB_ATTACH_START(udav, sc, uaa);
+ struct udav_softc *sc = (struct udav_softc *)self;
+ struct usb_attach_arg *uaa = aux;
usbd_device_handle dev = uaa->device;
usbd_interface_handle iface;
usbd_status err;
@@ -184,8 +187,7 @@ USB_ATTACH(udav)
int i, s;
devinfop = usbd_devinfo_alloc(dev, 0);
- USB_ATTACH_SETUP;
- printf("%s: %s", devname, devinfop);
+ printf("\n%s: %s", devname, devinfop);
usbd_devinfo_free(devinfop);
/* Move the device into the configured state. */
@@ -295,17 +297,17 @@ USB_ATTACH(udav)
usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, dev, USBDEV(sc->sc_dev));
- USB_ATTACH_SUCCESS_RETURN;
+ return;
bad:
sc->sc_dying = 1;
- USB_ATTACH_ERROR_RETURN;
}
/* detach */
-USB_DETACH(udav)
+int
+udav_detach(struct device *self, int flags)
{
- USB_DETACH_START(udav, sc);
+ struct udav_softc *sc = (struct udav_softc *)self;
struct ifnet *ifp = GET_IFP(sc);
int s;