Nuke USB_DECLARE_DRIVER and USB_DECLARE_DRIVER_INIT macros.
authorHasso Tepper <hasso@dragonflybsd.org>
Mon, 2 Jul 2007 23:52:05 +0000 (23:52 +0000)
committerHasso Tepper <hasso@dragonflybsd.org>
Mon, 2 Jul 2007 23:52:05 +0000 (23:52 +0000)
16 files changed:
sys/bus/usb/uhub.c
sys/bus/usb/usb.c
sys/dev/disk/nata/ata-usb.c
sys/dev/netif/rum/if_rum.c
sys/dev/netif/ural/if_ural.c
sys/dev/sound/usb/uaudio.c
sys/dev/usbmisc/udbp/udbp.c
sys/dev/usbmisc/ufm/ufm.c
sys/dev/usbmisc/ugen/ugen.c
sys/dev/usbmisc/uhid/uhid.c
sys/dev/usbmisc/ukbd/ukbd.c
sys/dev/usbmisc/ulpt/ulpt.c
sys/dev/usbmisc/umass/umass.c
sys/dev/usbmisc/ums/ums.c
sys/dev/usbmisc/urio/urio.c
sys/dev/usbmisc/uscanner/uscanner.c

index 3f47ad6..9c2a30b 100644 (file)
@@ -1,6 +1,6 @@
 /*     $NetBSD: uhub.c,v 1.68 2004/06/29 06:30:05 mycroft Exp $        */
 /*     $FreeBSD: src/sys/dev/usb/uhub.c,v 1.69.2.1 2005/12/18 15:51:31 iedowse Exp $   */
-/*     $DragonFly: src/sys/bus/usb/uhub.c,v 1.17 2007/07/01 21:24:02 hasso Exp $       */
+/*     $DragonFly: src/sys/bus/usb/uhub.c,v 1.18 2007/07/02 23:52:04 hasso Exp $       */
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -96,15 +96,33 @@ static bus_child_pnpinfo_str_t uhub_child_pnpinfo_str;
  * Every other driver only connects to hubs
  */
 
-USB_DECLARE_DRIVER_INIT(uhub,
+static device_probe_t uhub_match;
+static device_attach_t uhub_attach;
+static device_detach_t uhub_detach;
+
+static devclass_t uhub_devclass;
+
+static kobj_method_t uhub_methods[] = {
+       DEVMETHOD(device_probe, uhub_match),
+       DEVMETHOD(device_attach, uhub_attach),
+       DEVMETHOD(device_detach, uhub_detach),
        DEVMETHOD(bus_child_detached, uhub_child_detached),
        DEVMETHOD(bus_child_pnpinfo_str, uhub_child_pnpinfo_str),
        DEVMETHOD(bus_child_location_str, uhub_child_location_str),
        DEVMETHOD(bus_driver_added, bus_generic_driver_added),
        DEVMETHOD(device_suspend, bus_generic_suspend),
        DEVMETHOD(device_resume, bus_generic_resume),
-       DEVMETHOD(device_shutdown, bus_generic_shutdown)
-       );
+       DEVMETHOD(device_shutdown, bus_generic_shutdown),
+       {0,0}
+};
+
+static driver_t uhub_driver = {
+       "uhub",
+       uhub_methods,
+       sizeof(struct uhub_softc)
+};
+
+MODULE_DEPEND(uhub, usb, 1, 1, 1);
 
 /* Create the driver instance for the hub connected to usb case. */
 devclass_t uhubroot_devclass;
index fb1b01b..a31083d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * $NetBSD: usb.c,v 1.68 2002/02/20 20:30:12 christos Exp $
  * $FreeBSD: src/sys/dev/usb/usb.c,v 1.106 2005/03/27 15:31:23 iedowse Exp $
- * $DragonFly: src/sys/bus/usb/usb.c,v 1.37 2007/07/02 06:43:31 hasso Exp $
+ * $DragonFly: src/sys/bus/usb/usb.c,v 1.38 2007/07/02 23:52:04 hasso Exp $
  */
 
 /* Also already merged from NetBSD:
@@ -174,13 +174,30 @@ static int usb_get_next_event(struct usb_event *);
 
 static const char *usbrev_str[] = USBREV_STR;
 
-USB_DECLARE_DRIVER_INIT(usb,
-                       DEVMETHOD(bus_child_detached, usb_child_detached),
-                       DEVMETHOD(device_suspend, bus_generic_suspend),
-                       DEVMETHOD(device_resume, bus_generic_resume),
-                       DEVMETHOD(device_shutdown, bus_generic_shutdown)
-                       );
+static device_probe_t usb_match;
+static device_attach_t usb_attach;
+static device_detach_t usb_detach;
+
+static devclass_t usb_devclass;
+
+static kobj_method_t usb_methods[] = {
+       DEVMETHOD(device_probe, usb_match),
+       DEVMETHOD(device_attach, usb_attach),
+       DEVMETHOD(device_detach, usb_detach),
+       DEVMETHOD(bus_child_detached, usb_child_detached),
+       DEVMETHOD(device_suspend, bus_generic_suspend),
+       DEVMETHOD(device_resume, bus_generic_resume),
+       DEVMETHOD(device_shutdown, bus_generic_shutdown),
+       {0,0}
+};
+
+static driver_t usb_driver = {
+       "usb",
+       usb_methods,
+       sizeof(struct usb_softc)
+};
 
+MODULE_DEPEND(usb, usb, 1, 1, 1);
 MODULE_VERSION(usb, 1);
 
 static int
index e974398..9c39fff 100644 (file)
@@ -24,7 +24,7 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
  * $FreeBSD: src/sys/dev/ata/ata-usb.c,v 1.4 2006/03/31 08:09:05 sos Exp $
- * $DragonFly: src/sys/dev/disk/nata/ata-usb.c,v 1.6 2007/06/28 06:32:31 hasso Exp $
+ * $DragonFly: src/sys/dev/disk/nata/ata-usb.c,v 1.7 2007/07/02 23:52:04 hasso Exp $
  */
 
 #include "opt_ata.h"
@@ -142,7 +142,26 @@ int ata_usbchannel_end_transaction(struct ata_request *request);
 /*
  * USB frontend part
  */
-USB_DECLARE_DRIVER(atausb);
+static device_probe_t atausb_match;
+static device_attach_t atausb_attach;
+static device_detach_t atausb_detach;
+
+static devclass_t atausb_devclass;
+
+static kobj_method_t atausb_methods[] = {
+       DEVMETHOD(device_probe, atausb_match),
+       DEVMETHOD(device_attach, atausb_attach),
+       DEVMETHOD(device_detach, atausb_detach),
+       {0,0}
+};
+
+static driver_t atausb_driver = {
+       "atausb",
+       atausb_methods,
+       sizeof(struct atausb_softc)
+};
+
+MODULE_DEPEND(atausb, usb, 1, 1, 1);
 DRIVER_MODULE(atausb, uhub, atausb_driver, atausb_devclass, 0, 0);
 MODULE_VERSION(atausb, 1);
 
index 69160c9..789ef8e 100644 (file)
@@ -1,5 +1,5 @@
 /*     $OpenBSD: if_rum.c,v 1.40 2006/09/18 16:20:20 damien Exp $      */
-/*     $DragonFly: src/sys/dev/netif/rum/if_rum.c,v 1.16 2007/07/01 21:24:02 hasso Exp $       */
+/*     $DragonFly: src/sys/dev/netif/rum/if_rum.c,v 1.17 2007/07/02 23:52:04 hasso Exp $       */
 
 /*-
  * Copyright (c) 2005, 2006 Damien Bergamini <damien.bergamini@free.fr>
@@ -216,7 +216,26 @@ static const struct rfprog {
        RT2573_RF5225
 };
 
-USB_DECLARE_DRIVER(rum);
+static device_probe_t rum_match;
+static device_attach_t rum_attach;
+static device_detach_t rum_detach;
+
+static devclass_t rum_devclass;
+
+static kobj_method_t rum_methods[] = {
+       DEVMETHOD(device_probe, rum_match),
+       DEVMETHOD(device_attach, rum_attach),
+       DEVMETHOD(device_detach, rum_detach),
+       {0,0}
+};
+
+static driver_t rum_driver = {
+       "rum",
+       rum_methods,
+       sizeof(struct rum_softc)
+};
+
+MODULE_DEPEND(rum, usb, 1, 1, 1);
 DRIVER_MODULE(rum, uhub, rum_driver, rum_devclass, usbd_driver_load, 0);
 
 static int
index 3ede561..8e98b6d 100644 (file)
@@ -1,5 +1,5 @@
 /*     $FreeBSD: src/sys/dev/usb/if_ural.c,v 1.10.2.8 2006/07/08 07:48:43 maxim Exp $  */
-/*     $DragonFly: src/sys/dev/netif/ural/if_ural.c,v 1.16 2007/07/01 21:24:02 hasso Exp $     */
+/*     $DragonFly: src/sys/dev/netif/ural/if_ural.c,v 1.17 2007/07/02 23:52:05 hasso Exp $     */
 
 /*-
  * Copyright (c) 2005, 2006
@@ -341,7 +341,26 @@ static const struct {
        { 161, 0x08808, 0x0242f, 0x00281 }
 };
 
-USB_DECLARE_DRIVER(ural);
+static device_probe_t ural_match;
+static device_attach_t ural_attach;
+static device_detach_t ural_detach;
+
+static devclass_t ural_devclass;
+
+static kobj_method_t ural_methods[] = {
+       DEVMETHOD(device_probe, ural_match),
+       DEVMETHOD(device_attach, ural_attach),
+       DEVMETHOD(device_detach, ural_detach),
+       {0,0}
+};
+
+static driver_t ural_driver = {
+       "ural",
+       ural_methods,
+       sizeof(struct ural_softc)
+};
+
+MODULE_DEPEND(ural, usb, 1, 1, 1);
 
 static int
 ural_match(device_t self)
index 67735b1..3f481ba 100644 (file)
@@ -1,6 +1,6 @@
 /*     $NetBSD: uaudio.c,v 1.91 2004/11/05 17:46:14 kent Exp $ */
 /*     $FreeBSD: src/sys/dev/sound/usb/uaudio.c,v 1.14.2.2 2006/04/04 17:34:10 ariff Exp $ */
-/*     $DragonFly: src/sys/dev/sound/usb/uaudio.c,v 1.15 2007/07/01 21:24:02 hasso Exp $: */
+/*     $DragonFly: src/sys/dev/sound/usb/uaudio.c,v 1.16 2007/07/02 23:52:05 hasso Exp $: */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -487,12 +487,30 @@ USB_DECLARE_DRIVER(uaudio);
 
 #elif defined(__FreeBSD__) || defined(__DragonFly__)
 
-USB_DECLARE_DRIVER_INIT(uaudio,
-               DEVMETHOD(device_suspend, bus_generic_suspend),
-               DEVMETHOD(device_resume, bus_generic_resume),
-               DEVMETHOD(device_shutdown, bus_generic_shutdown),
-               DEVMETHOD(bus_print_child, bus_generic_print_child)
-               );
+static device_probe_t uaudio_match;
+static device_attach_t uaudio_attach;
+static device_detach_t uaudio_detach;
+
+static devclass_t uaudio_devclass;
+
+static kobj_method_t uaudio_methods[] = {
+       DEVMETHOD(device_probe, uaudio_match),
+       DEVMETHOD(device_attach, uaudio_attach),
+       DEVMETHOD(device_detach, uaudio_detach),
+       DEVMETHOD(device_suspend, bus_generic_suspend),
+       DEVMETHOD(device_resume, bus_generic_resume),
+       DEVMETHOD(device_shutdown, bus_generic_shutdown),
+       DEVMETHOD(bus_print_child, bus_generic_print_child),
+       {0,0}
+};
+
+static driver_t uaudio_driver = {
+       "uaudio",
+       uaudio_methods,
+       sizeof(struct uaudio_softc)
+};
+
+MODULE_DEPEND(uaudio, usb, 1, 1, 1);
 #endif
 
 
index c27730a..ec2d98a 100644 (file)
@@ -27,7 +27,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  *
  * $FreeBSD: src/sys/dev/usb/udbp.c,v 1.24 2003/08/24 17:55:55 obrien Exp $
- * $DragonFly: src/sys/dev/usbmisc/udbp/Attic/udbp.c,v 1.14 2007/07/01 21:24:03 hasso Exp $
+ * $DragonFly: src/sys/dev/usbmisc/udbp/Attic/udbp.c,v 1.15 2007/07/02 23:52:05 hasso Exp $
  */
 
 /* Driver for arbitrary double bulk pipe devices.
@@ -216,7 +216,26 @@ static void udbp_out_transfer_cb   (usbd_xfer_handle xfer,
                                        usbd_private_handle priv,
                                        usbd_status err);
 
-USB_DECLARE_DRIVER(udbp);
+static device_probe_t udbp_match;
+static device_attach_t udbp_attach;
+static device_detach_t udbp_detach;
+
+static devclass_t udbp_devclass;
+
+static kobj_method_t udbp_methods[] = {
+       DEVMETHOD(device_probe, udbp_match),
+       DEVMETHOD(device_attach, udbp_attach),
+       DEVMETHOD(device_detach, udbp_detach),
+       {0,0}
+};
+
+static driver_t udbp_driver = {
+       "udbp",
+       udbp_methods,
+       sizeof(struct udbp_softc)
+};
+
+MODULE_DEPEND(udbp, usb, 1, 1, 1);
 
 static int
 udbp_match(device_t self)
index 9ad48d2..2995d64 100644 (file)
@@ -30,7 +30,7 @@
 
 /*
  * $FreeBSD: src/sys/dev/usb/ufm.c,v 1.16 2003/10/04 21:41:01 joe Exp $
- * $DragonFly: src/sys/dev/usbmisc/ufm/ufm.c,v 1.18 2007/07/02 06:43:31 hasso Exp $
+ * $DragonFly: src/sys/dev/usbmisc/ufm/ufm.c,v 1.19 2007/07/02 23:52:05 hasso Exp $
  */
 
 #include <sys/param.h>
@@ -102,7 +102,26 @@ struct ufm_softc {
 
 #define UFMUNIT(n) (minor(n))
 
-USB_DECLARE_DRIVER(ufm);
+static device_probe_t ufm_match;
+static device_attach_t ufm_attach;
+static device_detach_t ufm_detach;
+
+static devclass_t ufm_devclass;
+
+static kobj_method_t ufm_methods[] = {
+       DEVMETHOD(device_probe, ufm_match),
+       DEVMETHOD(device_attach, ufm_attach),
+       DEVMETHOD(device_detach, ufm_detach),
+       {0,0}
+};
+
+static driver_t ufm_driver = {
+       "ufm",
+       ufm_methods,
+       sizeof(struct ufm_softc)
+};
+
+MODULE_DEPEND(ufm, usb, 1, 1, 1);
 
 static int
 ufm_match(device_t self)
index 6dfba26..4575994 100644 (file)
@@ -2,7 +2,7 @@
  * $NetBSD: ugen.c,v 1.27 1999/10/28 12:08:38 augustss Exp $
  * $NetBSD: ugen.c,v 1.59 2002/07/11 21:14:28 augustss Exp $
  * $FreeBSD: src/sys/dev/usb/ugen.c,v 1.81 2003/11/09 09:17:22 tanimura Exp $
- * $DragonFly: src/sys/dev/usbmisc/ugen/ugen.c,v 1.30 2007/07/02 06:43:31 hasso Exp $
+ * $DragonFly: src/sys/dev/usbmisc/ugen/ugen.c,v 1.31 2007/07/02 23:52:05 hasso Exp $
  */
 
 /* 
@@ -175,7 +175,26 @@ static int ugen_get_alt_index(struct ugen_softc *sc, int ifaceidx);
 #define UGENMINOR(u, e) (((u & 0xf) << 4) | ((u & 0xf0) << 12) | (e))
 #define UGENUNITMASK   0xffff00f0
 
-USB_DECLARE_DRIVER(ugen);
+static device_probe_t ugen_match;
+static device_attach_t ugen_attach;
+static device_detach_t ugen_detach;
+
+static devclass_t ugen_devclass;
+
+static kobj_method_t ugen_methods[] = {
+       DEVMETHOD(device_probe, ugen_match),
+       DEVMETHOD(device_attach, ugen_attach),
+       DEVMETHOD(device_detach, ugen_detach),
+       {0,0}
+};
+
+static driver_t ugen_driver = {
+       "ugen",
+       ugen_methods,
+       sizeof(struct ugen_softc)
+};
+
+MODULE_DEPEND(ugen, usb, 1, 1, 1);
 
 static int
 ugen_match(device_t self)
index 402dba8..9e445a6 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * $NetBSD: uhid.c,v 1.46 2001/11/13 06:24:55 lukem Exp $
  * $FreeBSD: src/sys/dev/usb/uhid.c,v 1.65 2003/11/09 09:17:22 tanimura Exp $
- * $DragonFly: src/sys/dev/usbmisc/uhid/uhid.c,v 1.27 2007/07/02 06:43:31 hasso Exp $
+ * $DragonFly: src/sys/dev/usbmisc/uhid/uhid.c,v 1.28 2007/07/02 23:52:05 hasso Exp $
  */
 
 /* Also already merged from NetBSD:
@@ -155,7 +155,26 @@ static int uhid_do_read(struct uhid_softc *, struct uio *uio, int);
 static int uhid_do_write(struct uhid_softc *, struct uio *uio, int);
 static int uhid_do_ioctl(struct uhid_softc *, u_long, caddr_t, int);
 
-USB_DECLARE_DRIVER(uhid);
+static device_probe_t uhid_match;
+static device_attach_t uhid_attach;
+static device_detach_t uhid_detach;
+
+static devclass_t uhid_devclass;
+
+static kobj_method_t uhid_methods[] = {
+       DEVMETHOD(device_probe, uhid_match),
+       DEVMETHOD(device_attach, uhid_attach),
+       DEVMETHOD(device_detach, uhid_detach),
+       {0,0}
+};
+
+static driver_t uhid_driver = {
+       "uhid",
+       uhid_methods,
+       sizeof(struct uhid_softc)
+};
+
+MODULE_DEPEND(uhid, usb, 1, 1, 1);
 
 static int
 uhid_match(device_t self)
index f9e758b..718606b 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * $FreeBSD: src/sys/dev/usb/ukbd.c,v 1.45 2003/10/04 21:41:01 joe Exp $
- * $DragonFly: src/sys/dev/usbmisc/ukbd/ukbd.c,v 1.22 2007/07/01 21:24:03 hasso Exp $
+ * $DragonFly: src/sys/dev/usbmisc/ukbd/ukbd.c,v 1.23 2007/07/02 23:52:05 hasso Exp $
  */
 
 /*
@@ -126,7 +126,27 @@ static int         ukbd_default_term(keyboard_t *kbd);
 
 static keyboard_t      default_kbd;
 
-USB_DECLARE_DRIVER_INIT(ukbd, DEVMETHOD(device_resume, ukbd_resume));
+static device_probe_t ukbd_match;
+static device_attach_t ukbd_attach;
+static device_detach_t ukbd_detach;
+
+static devclass_t ukbd_devclass;
+
+static kobj_method_t ukbd_methods[] = {
+       DEVMETHOD(device_probe, ukbd_match),
+       DEVMETHOD(device_attach, ukbd_attach),
+       DEVMETHOD(device_detach, ukbd_detach),
+       DEVMETHOD(device_resume, ukbd_resume),
+       {0,0}
+};
+
+static driver_t ukbd_driver = {
+       "ukbd",
+       ukbd_methods,
+       sizeof(struct ukbd_softc)
+};
+
+MODULE_DEPEND(ukbd, usb, 1, 1, 1);
 
 static int
 ukbd_match(device_t self)
index da951a8..1822216 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * $NetBSD: ulpt.c,v 1.55 2002/10/23 09:14:01 jdolecek Exp $
  * $FreeBSD: src/sys/dev/usb/ulpt.c,v 1.59 2003/09/28 20:48:13 phk Exp $
- * $DragonFly: src/sys/dev/usbmisc/ulpt/ulpt.c,v 1.21 2007/07/02 06:43:31 hasso Exp $
+ * $DragonFly: src/sys/dev/usbmisc/ulpt/ulpt.c,v 1.22 2007/07/02 23:52:05 hasso Exp $
  */
 
 /*
@@ -149,7 +149,26 @@ void ieee1284_print_id(char *);
 #define        ULPTFLAGS(s)    (minor(s) & 0xe0)
 
 
-USB_DECLARE_DRIVER(ulpt);
+static device_probe_t ulpt_match;
+static device_attach_t ulpt_attach;
+static device_detach_t ulpt_detach;
+
+static devclass_t ulpt_devclass;
+
+static kobj_method_t ulpt_methods[] = {
+       DEVMETHOD(device_probe, ulpt_match),
+       DEVMETHOD(device_attach, ulpt_attach),
+       DEVMETHOD(device_detach, ulpt_detach),
+       {0,0}
+};
+
+static driver_t ulpt_driver = {
+       "ulpt",
+       ulpt_methods,
+       sizeof(struct ulpt_softc)
+};
+
+MODULE_DEPEND(ulpt, usb, 1, 1, 1);
 
 static int
 ulpt_match(device_t self)
index 39c2e3e..b926e06 100644 (file)
@@ -26,7 +26,7 @@
  *
  * $NetBSD: umass.c,v 1.28 2000/04/02 23:46:53 augustss Exp $
  * $FreeBSD: src/sys/dev/usb/umass.c,v 1.96 2003/12/19 12:19:11 sanpei Exp $
- * $DragonFly: src/sys/dev/usbmisc/umass/umass.c,v 1.26 2007/07/01 21:24:03 hasso Exp $
+ * $DragonFly: src/sys/dev/usbmisc/umass/umass.c,v 1.27 2007/07/02 23:52:05 hasso Exp $
  */
 
 /*
@@ -568,7 +568,28 @@ static uint8_t fake_inq_data[SHORT_INQUIRY_LENGTH] = {
 };
 
 /* USB device probe/attach/detach functions */
-USB_DECLARE_DRIVER(umass);
+static device_probe_t umass_match;
+static device_attach_t umass_attach;
+static device_detach_t umass_detach;
+
+static devclass_t umass_devclass;
+
+static kobj_method_t umass_methods[] = {
+       DEVMETHOD(device_probe, umass_match),
+       DEVMETHOD(device_attach, umass_attach),
+       DEVMETHOD(device_detach, umass_detach),
+       {0,0},
+       {0,0}
+};
+
+static driver_t umass_driver = {
+       "umass",
+       umass_methods,
+       sizeof(struct umass_softc)
+};
+
+MODULE_DEPEND(umass, usb, 1, 1, 1);
+
 static int umass_match_proto   (struct umass_softc *sc,
                                usbd_interface_handle iface,
                                usbd_device_handle udev);
index 35eac3e..c12addd 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * $FreeBSD: src/sys/dev/usb/ums.c,v 1.64 2003/11/09 09:17:22 tanimura Exp $
- * $DragonFly: src/sys/dev/usbmisc/ums/ums.c,v 1.26 2007/07/02 06:43:31 hasso Exp $
+ * $DragonFly: src/sys/dev/usbmisc/ums/ums.c,v 1.27 2007/07/02 23:52:05 hasso Exp $
  */
 
 /*
@@ -155,7 +155,26 @@ static struct dev_ops ums_ops = {
        .d_poll =       ums_poll,
 };
 
-USB_DECLARE_DRIVER(ums);
+static device_probe_t ums_match;
+static device_attach_t ums_attach;
+static device_detach_t ums_detach;
+
+static devclass_t ums_devclass;
+
+static kobj_method_t ums_methods[] = {
+       DEVMETHOD(device_probe, ums_match),
+       DEVMETHOD(device_attach, ums_attach),
+       DEVMETHOD(device_detach, ums_detach),
+       {0,0}
+};
+
+static driver_t ums_driver = {
+       "ums",
+       ums_methods,
+       sizeof(struct ums_softc)
+};
+
+MODULE_DEPEND(ums, usb, 1, 1, 1);
 
 static int
 ums_match(device_t self)
index 8240af2..783e77a 100644 (file)
@@ -30,7 +30,7 @@
 
 /*
  * $FreeBSD: src/sys/dev/usb/urio.c,v 1.28 2003/08/25 22:01:06 joe Exp $
- * $DragonFly: src/sys/dev/usbmisc/urio/urio.c,v 1.21 2007/07/02 06:43:31 hasso Exp $
+ * $DragonFly: src/sys/dev/usbmisc/urio/urio.c,v 1.22 2007/07/02 23:52:05 hasso Exp $
  */
 
 /*
@@ -130,7 +130,26 @@ struct urio_softc {
 
 #define RIO_RW_TIMEOUT 4000    /* ms */
 
-USB_DECLARE_DRIVER(urio);
+static device_probe_t urio_match;
+static device_attach_t urio_attach;
+static device_detach_t urio_detach;
+
+static devclass_t urio_devclass;
+
+static kobj_method_t urio_methods[] = {
+       DEVMETHOD(device_probe, urio_match),
+       DEVMETHOD(device_attach, urio_attach),
+       DEVMETHOD(device_detach, urio_detach),
+       {0,0}
+};
+
+static driver_t urio_driver = {
+       "urio",
+       urio_methods,
+       sizeof(struct urio_softc)
+};
+
+MODULE_DEPEND(urio, usb, 1, 1, 1);
 
 static int
 urio_match(device_t self)
index 3d5ff23..2beb88b 100644 (file)
@@ -1,7 +1,7 @@
 /* 
  * $NetBSD: uscanner.c,v 1.30 2002/07/11 21:14:36 augustss Exp $
  * $FreeBSD: src/sys/dev/usb/uscanner.c,v 1.48 2003/12/22 19:58:27 sanpei Exp $
- * $DragonFly: src/sys/dev/usbmisc/uscanner/uscanner.c,v 1.21 2007/07/02 06:43:31 hasso Exp $
+ * $DragonFly: src/sys/dev/usbmisc/uscanner/uscanner.c,v 1.22 2007/07/02 23:52:05 hasso Exp $
  */
 
 /* Also already merged from NetBSD:
@@ -269,7 +269,26 @@ static void uscanner_do_close(struct uscanner_softc *);
 
 #define USCANNERUNIT(n) (minor(n))
 
-USB_DECLARE_DRIVER(uscanner);
+static device_probe_t uscanner_match;
+static device_attach_t uscanner_attach;
+static device_detach_t uscanner_detach;
+
+static devclass_t uscanner_devclass;
+
+static kobj_method_t uscanner_methods[] = {
+       DEVMETHOD(device_probe, uscanner_match),
+       DEVMETHOD(device_attach, uscanner_attach),
+       DEVMETHOD(device_detach, uscanner_detach),
+       {0,0}
+};
+
+static driver_t uscanner_driver = {
+       "uscanner",
+       uscanner_methods,
+       sizeof(struct uscanner_softc)
+};
+
+MODULE_DEPEND(uscanner, usb, 1, 1, 1);
 
 static int
 uscanner_match(device_t self)