From 058cc61a3ef6bb26bc6d9a6b8796a0b46faa5e4b Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Thu, 14 Jun 2007 15:09:21 +0000 Subject: [PATCH] Move malloc definitions to usb.h. Also, remove usb_malloc_type: it was unused. Remove METHODS_NONE: it was unused. Move include of opt_usb.h from usb_port.h to usb.h, since usb_port.h is going away (there will be a usb_compat.h for out-of-tree drivers that want it). --- sys/dev/usb/usb.h | 7 +++---- sys/dev/usb/usb_port.h | 16 +--------------- 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/sys/dev/usb/usb.h b/sys/dev/usb/usb.h index 2deae80c199..24c54e99863 100644 --- a/sys/dev/usb/usb.h +++ b/sys/dev/usb/usb.h @@ -45,16 +45,15 @@ #include #include -#if defined(_KERNEL) -#if 1 #include -#else +#if defined(_KERNEL) +#include "opt_usb.h" + #include MALLOC_DECLARE(M_USB); MALLOC_DECLARE(M_USBDEV); MALLOC_DECLARE(M_USBHC); -#endif #endif /* _KERNEL */ /* These two defines are used by usbd to autoload the usb kld */ diff --git a/sys/dev/usb/usb_port.h b/sys/dev/usb/usb_port.h index 8269c2c21b8..d92a5880791 100644 --- a/sys/dev/usb/usb_port.h +++ b/sys/dev/usb/usb_port.h @@ -55,17 +55,6 @@ * FreeBSD */ -#include "opt_usb.h" - -#if defined(_KERNEL) -#include - -MALLOC_DECLARE(M_USB); -MALLOC_DECLARE(M_USBDEV); -MALLOC_DECLARE(M_USBHC); - -#endif - /* We don't use the soft interrupt code in FreeBSD. */ #if 0 #define USB_USE_SOFTINTR @@ -85,8 +74,6 @@ typedef struct callout usb_callout_t; #define PWR_RESUME 0 #define PWR_SUSPEND 1 -typedef struct malloc_type *usb_malloc_type; - #define USB_DECLARE_DRIVER_INIT(dname, init...) \ static device_probe_t __CONCAT(dname,_match); \ static device_attach_t __CONCAT(dname,_attach); \ @@ -110,8 +97,7 @@ static driver_t __CONCAT(dname,_driver) = { \ MODULE_DEPEND(dname, usb, 1, 1, 1) -#define METHODS_NONE {0,0} -#define USB_DECLARE_DRIVER(dname) USB_DECLARE_DRIVER_INIT(dname, METHODS_NONE) +#define USB_DECLARE_DRIVER(dname) USB_DECLARE_DRIVER_INIT(dname, {0,0}) #define USB_MATCH(dname) \ static int \