aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/core/urb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/core/urb.c')
-rw-r--r--drivers/usb/core/urb.c21
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/*-------------------------------------------------------------------*/