summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/usb/usb.c3
-rw-r--r--sys/dev/usb/usb_port.h15
2 files changed, 13 insertions, 5 deletions
diff --git a/sys/dev/usb/usb.c b/sys/dev/usb/usb.c
index b623cf2..3688aad 100644
--- a/sys/dev/usb/usb.c
+++ b/sys/dev/usb/usb.c
@@ -64,6 +64,7 @@
#include <sys/vnode.h>
#include <sys/signalvar.h>
+#define USBCORE
#include <dev/usb/usb.h>
#include <dev/usb/usbdi.h>
#include <dev/usb/usbdi_util.h>
@@ -180,8 +181,6 @@ USB_DECLARE_DRIVER_INIT(usb,
DEVMETHOD(device_shutdown, bus_generic_shutdown)
);
-MODULE_VERSION(usb, 1);
-
USB_MATCH(usb)
{
DPRINTF(("usbd_match\n"));
diff --git a/sys/dev/usb/usb_port.h b/sys/dev/usb/usb_port.h
index 4d706c9..61ac382 100644
--- a/sys/dev/usb/usb_port.h
+++ b/sys/dev/usb/usb_port.h
@@ -299,7 +299,7 @@ __CONCAT(dname,_detach)(self, flags) \
#define PWR_RESUME 0
#define PWR_SUSPEND 1
-#define USB_DECLARE_DRIVER_INIT(dname, init...) \
+#define USB_DECLARE_DRIVER_INIT2(dname, init...) \
Static device_probe_t __CONCAT(dname,_match); \
Static device_attach_t __CONCAT(dname,_attach); \
Static device_detach_t __CONCAT(dname,_detach); \
@@ -318,8 +318,17 @@ Static driver_t __CONCAT(dname,_driver) = { \
#dname, \
__CONCAT(dname,_methods), \
sizeof(struct __CONCAT(dname,_softc)) \
-}; \
-MODULE_DEPEND(dname, usb, 1, 1, 1)
+}
+
+#ifdef USBCORE
+#define USB_DECLARE_DRIVER_INIT(dname, init...) \
+ USB_DECLARE_DRIVER_INIT2(dname, init); \
+ MODULE_VERSION(usb, 1)
+#else
+#define USB_DECLARE_DRIVER_INIT(dname, init...) \
+ USB_DECLARE_DRIVER_INIT2(dname, init); \
+ MODULE_DEPEND(dname, usb, 1, 1, 1)
+#endif
#define METHODS_NONE {0,0}
#define USB_DECLARE_DRIVER(dname) USB_DECLARE_DRIVER_INIT(dname, METHODS_NONE)
OpenPOWER on IntegriCloud