X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fusb%2Fcore%2Fbuffer.c;h=c3915dc28608da7aa3ef3ae88fc005cbdf37eba7;hb=97bf2856c6014879bd04983a3e9dfcdac1e7fe85;hp=1e2a42ad34a40e152eab5af2d14a698518f7112f;hpb=9bf4aaab3e101692164d49b7ca357651eb691cb6;p=linux-2.6.git diff --git a/drivers/usb/core/buffer.c b/drivers/usb/core/buffer.c index 1e2a42ad3..c3915dc28 100644 --- a/drivers/usb/core/buffer.c +++ b/drivers/usb/core/buffer.c @@ -5,7 +5,6 @@ * and should work with all USB controllers, regardles of bus type. */ -#include #include #include #include @@ -15,14 +14,6 @@ #include #include #include - - -#ifdef CONFIG_USB_DEBUG - #define DEBUG -#else - #undef DEBUG -#endif - #include #include "hcd.h" @@ -63,6 +54,9 @@ int hcd_buffer_create (struct usb_hcd *hcd) char name [16]; int i, size; + if (!hcd->self.controller->dma_mask) + return 0; + for (i = 0; i < HCD_BUFFER_POOLS; i++) { if (!(size = pool_max [i])) continue; @@ -76,7 +70,6 @@ int hcd_buffer_create (struct usb_hcd *hcd) } return 0; } -EXPORT_SYMBOL (hcd_buffer_create); /** @@ -98,21 +91,20 @@ void hcd_buffer_destroy (struct usb_hcd *hcd) } } } -EXPORT_SYMBOL (hcd_buffer_destroy); -/* sometimes alloc/free could use kmalloc with SLAB_DMA, for +/* sometimes alloc/free could use kmalloc with GFP_DMA, for * better sharing and to leverage mm/slab.c intelligence. */ void *hcd_buffer_alloc ( struct usb_bus *bus, size_t size, - int mem_flags, + gfp_t mem_flags, dma_addr_t *dma ) { - struct usb_hcd *hcd = bus->hcpriv; + struct usb_hcd *hcd = bus_to_hcd(bus); int i; /* some USB hosts just use PIO */ @@ -135,7 +127,7 @@ void hcd_buffer_free ( dma_addr_t dma ) { - struct usb_hcd *hcd = bus->hcpriv; + struct usb_hcd *hcd = bus_to_hcd(bus); int i; if (!addr)