diff options
Diffstat (limited to 'drivers/usb/misc/usbtest.c')
-rw-r--r-- | drivers/usb/misc/usbtest.c | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/drivers/usb/misc/usbtest.c b/drivers/usb/misc/usbtest.c index 54799eb0bc6..605a2afe34e 100644 --- a/drivers/usb/misc/usbtest.c +++ b/drivers/usb/misc/usbtest.c @@ -1,7 +1,4 @@ #include <linux/config.h> -#if !defined (DEBUG) && defined (CONFIG_USB_DEBUG) -# define DEBUG -#endif #include <linux/kernel.h> #include <linux/errno.h> #include <linux/init.h> @@ -9,7 +6,7 @@ #include <linux/mm.h> #include <linux/module.h> #include <linux/moduleparam.h> -#include <asm/scatterlist.h> +#include <linux/scatterlist.h> #include <linux/usb.h> @@ -381,7 +378,6 @@ alloc_sglist (int nents, int max, int vary) sg = kmalloc (nents * sizeof *sg, SLAB_KERNEL); if (!sg) return NULL; - memset (sg, 0, nents * sizeof *sg); for (i = 0; i < nents; i++) { char *buf; @@ -394,9 +390,7 @@ alloc_sglist (int nents, int max, int vary) memset (buf, 0, size); /* kmalloc pages are always physically contiguous! */ - sg [i].page = virt_to_page (buf); - sg [i].offset = offset_in_page (buf); - sg [i].length = size; + sg_init_one(&sg[i], buf, size); if (vary) { size += vary; @@ -983,6 +977,7 @@ test_ctrl_queue (struct usbtest_dev *dev, struct usbtest_param *param) reqp->number = i % NUM_SUBCASES; reqp->expected = expected; u->setup_packet = (char *) &reqp->setup; + u->transfer_flags |= URB_NO_SETUP_DMA_MAP; u->context = &context; u->complete = ctrl_complete; @@ -1948,21 +1943,11 @@ usbtest_probe (struct usb_interface *intf, const struct usb_device_id *id) static int usbtest_suspend (struct usb_interface *intf, pm_message_t message) { - struct usbtest_dev *dev = usb_get_intfdata (intf); - - down (&dev->sem); - intf->dev.power.power_state = PMSG_SUSPEND; - up (&dev->sem); return 0; } static int usbtest_resume (struct usb_interface *intf) { - struct usbtest_dev *dev = usb_get_intfdata (intf); - - down (&dev->sem); - intf->dev.power.power_state = PMSG_ON; - up (&dev->sem); return 0; } |