]> err.no Git - linux-2.6/blobdiff - drivers/usb/core/buffer.c
Pull button into test branch
[linux-2.6] / drivers / usb / core / buffer.c
index 419c9943a7cbde9428aef14df1f266bd7e32c142..c3915dc28608da7aa3ef3ae88fc005cbdf37eba7 100644 (file)
@@ -5,7 +5,6 @@
  * and should work with all USB controllers, regardles of bus type.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/slab.h>
@@ -55,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;
@@ -91,7 +93,7 @@ void hcd_buffer_destroy (struct usb_hcd *hcd)
 }
 
 
-/* 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.
  */
 
@@ -102,7 +104,7 @@ void *hcd_buffer_alloc (
        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 */
@@ -125,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)