]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - drivers/usb/storage/usb.c
USB: remove uses of URB_NO_SETUP_DMA_MAP
[net-next-2.6.git] / drivers / usb / storage / usb.c
index e9f995486ec1b1fa46021ed0bd3202044d0a425a..c54a370c76c529e2f6ede05f1f095d546cbef394 100644 (file)
@@ -78,7 +78,7 @@ MODULE_AUTHOR("Matthew Dharm <mdharm-usb@one-eyed-alien.net>");
 MODULE_DESCRIPTION("USB Mass Storage driver for Linux");
 MODULE_LICENSE("GPL");
 
-static unsigned int delay_use = 5;
+static unsigned int delay_use = 1;
 module_param(delay_use, uint, S_IRUGO | S_IWUSR);
 MODULE_PARM_DESC(delay_use, "seconds to delay before using a new device");
 
@@ -407,9 +407,8 @@ static int associate_dev(struct us_data *us, struct usb_interface *intf)
        /* Store our private data in the interface */
        usb_set_intfdata(intf, us);
 
-       /* Allocate the device-related DMA-mapped buffers */
-       us->cr = usb_buffer_alloc(us->pusb_dev, sizeof(*us->cr),
-                       GFP_KERNEL, &us->cr_dma);
+       /* Allocate the control/setup and DMA-mapped buffers */
+       us->cr = kmalloc(sizeof(*us->cr), GFP_KERNEL);
        if (!us->cr) {
                US_DEBUGP("usb_ctrlrequest allocation failed\n");
                return -ENOMEM;
@@ -757,13 +756,9 @@ static void dissociate_dev(struct us_data *us)
 {
        US_DEBUGP("-- %s\n", __func__);
 
-       /* Free the device-related DMA-mapped buffers */
-       if (us->cr)
-               usb_buffer_free(us->pusb_dev, sizeof(*us->cr), us->cr,
-                               us->cr_dma);
-       if (us->iobuf)
-               usb_buffer_free(us->pusb_dev, US_IOBUF_SIZE, us->iobuf,
-                               us->iobuf_dma);
+       /* Free the buffers */
+       kfree(us->cr);
+       usb_buffer_free(us->pusb_dev, US_IOBUF_SIZE, us->iobuf, us->iobuf_dma);
 
        /* Remove our private data from the interface */
        usb_set_intfdata(us->pusb_intf, NULL);