diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-07 22:23:21 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-07 22:23:21 -0500 |
commit | c96e2c92072d3e78954c961f53d8c7352f7abbd7 (patch) | |
tree | d844f26f926ff40e98e9eae0e11fd71acad81df4 /drivers/usb/core/urb.c | |
parent | f2aca47dc3c2d0c2d5dbd972558557e74232bbce (diff) | |
parent | 64358164f5bfe5e11d4040c1eb674c29e1436ce5 (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/usb-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/usb-2.6: (70 commits)
USB: remove duplicate device id from zc0301
USB: remove duplicate device id from usb_storage
USB: remove duplicate device id from keyspan
USB: remove duplicate device id from ftdi_sio
USB: remove duplicate device id from visor
USB: a bit more coding style cleanup
usbcore: trivial whitespace fixes
usb-storage: use first bulk endpoints, not last
EHCI: fix interrupt-driven remote wakeup
USB: switch ehci-hcd to new polling scheme
USB: autosuspend for usb printer driver
USB Input: Added kernel module to support all GTCO CalComp USB InterWrite School products
USB: Sierra Wireless auto set D0
USB: usb ethernet gadget recognizes HUSB2DEV
USB: list atmel husb2_udc gadget controller
USB: gadgetfs AIO tweaks
USB: gadgetfs behaves better on userspace init bug
USB: gadgetfs race fix
USB: gadgetfs simplifications
USB: gadgetfs cleanups
...
Diffstat (limited to 'drivers/usb/core/urb.c')
-rw-r--r-- | drivers/usb/core/urb.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/drivers/usb/core/urb.c b/drivers/usb/core/urb.c index 9801d08edacf..94ea9727ff55 100644 --- a/drivers/usb/core/urb.c +++ b/drivers/usb/core/urb.c | |||
@@ -235,16 +235,15 @@ int usb_submit_urb(struct urb *urb, gfp_t mem_flags) | |||
235 | 235 | ||
236 | urb->status = -EINPROGRESS; | 236 | urb->status = -EINPROGRESS; |
237 | urb->actual_length = 0; | 237 | urb->actual_length = 0; |
238 | urb->bandwidth = 0; | ||
239 | 238 | ||
240 | /* Lots of sanity checks, so HCDs can rely on clean data | 239 | /* Lots of sanity checks, so HCDs can rely on clean data |
241 | * and don't need to duplicate tests | 240 | * and don't need to duplicate tests |
242 | */ | 241 | */ |
243 | pipe = urb->pipe; | 242 | pipe = urb->pipe; |
244 | temp = usb_pipetype (pipe); | 243 | temp = usb_pipetype(pipe); |
245 | is_out = usb_pipeout (pipe); | 244 | is_out = usb_pipeout(pipe); |
246 | 245 | ||
247 | if (!usb_pipecontrol (pipe) && dev->state < USB_STATE_CONFIGURED) | 246 | if (!usb_pipecontrol(pipe) && dev->state < USB_STATE_CONFIGURED) |
248 | return -ENODEV; | 247 | return -ENODEV; |
249 | 248 | ||
250 | /* FIXME there should be a sharable lock protecting us against | 249 | /* FIXME there should be a sharable lock protecting us against |
@@ -253,11 +252,11 @@ int usb_submit_urb(struct urb *urb, gfp_t mem_flags) | |||
253 | * checks get made.) | 252 | * checks get made.) |
254 | */ | 253 | */ |
255 | 254 | ||
256 | max = usb_maxpacket (dev, pipe, is_out); | 255 | max = usb_maxpacket(dev, pipe, is_out); |
257 | if (max <= 0) { | 256 | if (max <= 0) { |
258 | dev_dbg(&dev->dev, | 257 | dev_dbg(&dev->dev, |
259 | "bogus endpoint ep%d%s in %s (bad maxpacket %d)\n", | 258 | "bogus endpoint ep%d%s in %s (bad maxpacket %d)\n", |
260 | usb_pipeendpoint (pipe), is_out ? "out" : "in", | 259 | usb_pipeendpoint(pipe), is_out ? "out" : "in", |
261 | __FUNCTION__, max); | 260 | __FUNCTION__, max); |
262 | return -EMSGSIZE; | 261 | return -EMSGSIZE; |
263 | } | 262 | } |
@@ -279,11 +278,11 @@ int usb_submit_urb(struct urb *urb, gfp_t mem_flags) | |||
279 | if (urb->number_of_packets <= 0) | 278 | if (urb->number_of_packets <= 0) |
280 | return -EINVAL; | 279 | return -EINVAL; |
281 | for (n = 0; n < urb->number_of_packets; n++) { | 280 | for (n = 0; n < urb->number_of_packets; n++) { |
282 | len = urb->iso_frame_desc [n].length; | 281 | len = urb->iso_frame_desc[n].length; |
283 | if (len < 0 || len > max) | 282 | if (len < 0 || len > max) |
284 | return -EMSGSIZE; | 283 | return -EMSGSIZE; |
285 | urb->iso_frame_desc [n].status = -EXDEV; | 284 | urb->iso_frame_desc[n].status = -EXDEV; |
286 | urb->iso_frame_desc [n].actual_length = 0; | 285 | urb->iso_frame_desc[n].actual_length = 0; |
287 | } | 286 | } |
288 | } | 287 | } |
289 | 288 | ||
@@ -322,7 +321,7 @@ int usb_submit_urb(struct urb *urb, gfp_t mem_flags) | |||
322 | 321 | ||
323 | /* fail if submitter gave bogus flags */ | 322 | /* fail if submitter gave bogus flags */ |
324 | if (urb->transfer_flags != orig_flags) { | 323 | if (urb->transfer_flags != orig_flags) { |
325 | err ("BOGUS urb flags, %x --> %x", | 324 | err("BOGUS urb flags, %x --> %x", |
326 | orig_flags, urb->transfer_flags); | 325 | orig_flags, urb->transfer_flags); |
327 | return -EINVAL; | 326 | return -EINVAL; |
328 | } | 327 | } |
@@ -373,7 +372,7 @@ int usb_submit_urb(struct urb *urb, gfp_t mem_flags) | |||
373 | urb->interval = temp; | 372 | urb->interval = temp; |
374 | } | 373 | } |
375 | 374 | ||
376 | return usb_hcd_submit_urb (urb, mem_flags); | 375 | return usb_hcd_submit_urb(urb, mem_flags); |
377 | } | 376 | } |
378 | 377 | ||
379 | /*-------------------------------------------------------------------*/ | 378 | /*-------------------------------------------------------------------*/ |