diff options
Diffstat (limited to 'drivers/usb/misc/usbtest.c')
-rw-r--r-- | drivers/usb/misc/usbtest.c | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/drivers/usb/misc/usbtest.c b/drivers/usb/misc/usbtest.c index 54799eb0bc60..2997f558159b 100644 --- a/drivers/usb/misc/usbtest.c +++ b/drivers/usb/misc/usbtest.c | |||
@@ -9,7 +9,7 @@ | |||
9 | #include <linux/mm.h> | 9 | #include <linux/mm.h> |
10 | #include <linux/module.h> | 10 | #include <linux/module.h> |
11 | #include <linux/moduleparam.h> | 11 | #include <linux/moduleparam.h> |
12 | #include <asm/scatterlist.h> | 12 | #include <linux/scatterlist.h> |
13 | 13 | ||
14 | #include <linux/usb.h> | 14 | #include <linux/usb.h> |
15 | 15 | ||
@@ -381,7 +381,6 @@ alloc_sglist (int nents, int max, int vary) | |||
381 | sg = kmalloc (nents * sizeof *sg, SLAB_KERNEL); | 381 | sg = kmalloc (nents * sizeof *sg, SLAB_KERNEL); |
382 | if (!sg) | 382 | if (!sg) |
383 | return NULL; | 383 | return NULL; |
384 | memset (sg, 0, nents * sizeof *sg); | ||
385 | 384 | ||
386 | for (i = 0; i < nents; i++) { | 385 | for (i = 0; i < nents; i++) { |
387 | char *buf; | 386 | char *buf; |
@@ -394,9 +393,7 @@ alloc_sglist (int nents, int max, int vary) | |||
394 | memset (buf, 0, size); | 393 | memset (buf, 0, size); |
395 | 394 | ||
396 | /* kmalloc pages are always physically contiguous! */ | 395 | /* kmalloc pages are always physically contiguous! */ |
397 | sg [i].page = virt_to_page (buf); | 396 | sg_init_one(&sg[i], buf, size); |
398 | sg [i].offset = offset_in_page (buf); | ||
399 | sg [i].length = size; | ||
400 | 397 | ||
401 | if (vary) { | 398 | if (vary) { |
402 | size += vary; | 399 | size += vary; |
@@ -983,6 +980,7 @@ test_ctrl_queue (struct usbtest_dev *dev, struct usbtest_param *param) | |||
983 | reqp->number = i % NUM_SUBCASES; | 980 | reqp->number = i % NUM_SUBCASES; |
984 | reqp->expected = expected; | 981 | reqp->expected = expected; |
985 | u->setup_packet = (char *) &reqp->setup; | 982 | u->setup_packet = (char *) &reqp->setup; |
983 | u->transfer_flags |= URB_NO_SETUP_DMA_MAP; | ||
986 | 984 | ||
987 | u->context = &context; | 985 | u->context = &context; |
988 | u->complete = ctrl_complete; | 986 | u->complete = ctrl_complete; |
@@ -1948,21 +1946,11 @@ usbtest_probe (struct usb_interface *intf, const struct usb_device_id *id) | |||
1948 | 1946 | ||
1949 | static int usbtest_suspend (struct usb_interface *intf, pm_message_t message) | 1947 | static int usbtest_suspend (struct usb_interface *intf, pm_message_t message) |
1950 | { | 1948 | { |
1951 | struct usbtest_dev *dev = usb_get_intfdata (intf); | ||
1952 | |||
1953 | down (&dev->sem); | ||
1954 | intf->dev.power.power_state = PMSG_SUSPEND; | ||
1955 | up (&dev->sem); | ||
1956 | return 0; | 1949 | return 0; |
1957 | } | 1950 | } |
1958 | 1951 | ||
1959 | static int usbtest_resume (struct usb_interface *intf) | 1952 | static int usbtest_resume (struct usb_interface *intf) |
1960 | { | 1953 | { |
1961 | struct usbtest_dev *dev = usb_get_intfdata (intf); | ||
1962 | |||
1963 | down (&dev->sem); | ||
1964 | intf->dev.power.power_state = PMSG_ON; | ||
1965 | up (&dev->sem); | ||
1966 | return 0; | 1954 | return 0; |
1967 | } | 1955 | } |
1968 | 1956 | ||