diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2007-08-24 15:42:24 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-10-12 17:55:23 -0400 |
commit | 4a00027dcb088bf90fa8fb14a7e8ba3506d78f22 (patch) | |
tree | 992b3dbda7b950b8906ac4751e43a28fd15e2e5d /drivers/usb/host/u132-hcd.c | |
parent | 9347d51c52afcf1a77d2104f162cf8a085624c83 (diff) |
USB: Eliminate urb->status usage!
This patch (as979) removes the last vestiges of urb->status from the
host controller drivers and the root-hub emulator. Now the field
doesn't get set until just before the URB's completion routine is
called.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
CC: David Brownell <david-b@pacbell.net>
CC: Olav Kongas <ok@artecdesign.ee>
CC: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
CC: Tony Olech <tony.olech@elandigitalsystems.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/host/u132-hcd.c')
-rw-r--r-- | drivers/usb/host/u132-hcd.c | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/drivers/usb/host/u132-hcd.c b/drivers/usb/host/u132-hcd.c index db800a434b83..2b379a78d0d5 100644 --- a/drivers/usb/host/u132-hcd.c +++ b/drivers/usb/host/u132-hcd.c | |||
@@ -518,7 +518,6 @@ static void u132_hcd_giveback_urb(struct u132 *u132, struct u132_endp *endp, | |||
518 | unsigned long irqs; | 518 | unsigned long irqs; |
519 | struct usb_hcd *hcd = u132_to_hcd(u132); | 519 | struct usb_hcd *hcd = u132_to_hcd(u132); |
520 | urb->error_count = 0; | 520 | urb->error_count = 0; |
521 | urb->status = status; | ||
522 | spin_lock_irqsave(&endp->queue_lock.slock, irqs); | 521 | spin_lock_irqsave(&endp->queue_lock.slock, irqs); |
523 | usb_hcd_unlink_urb_from_ep(hcd, urb); | 522 | usb_hcd_unlink_urb_from_ep(hcd, urb); |
524 | endp->queue_next += 1; | 523 | endp->queue_next += 1; |
@@ -542,7 +541,7 @@ static void u132_hcd_giveback_urb(struct u132 *u132, struct u132_endp *endp, | |||
542 | u132_ring_queue_work(u132, ring, 0); | 541 | u132_ring_queue_work(u132, ring, 0); |
543 | up(&u132->scheduler_lock); | 542 | up(&u132->scheduler_lock); |
544 | u132_endp_put_kref(u132, endp); | 543 | u132_endp_put_kref(u132, endp); |
545 | usb_hcd_giveback_urb(hcd, urb); | 544 | usb_hcd_giveback_urb(hcd, urb, status); |
546 | return; | 545 | return; |
547 | } | 546 | } |
548 | 547 | ||
@@ -558,7 +557,6 @@ static void u132_hcd_abandon_urb(struct u132 *u132, struct u132_endp *endp, | |||
558 | unsigned long irqs; | 557 | unsigned long irqs; |
559 | struct usb_hcd *hcd = u132_to_hcd(u132); | 558 | struct usb_hcd *hcd = u132_to_hcd(u132); |
560 | urb->error_count = 0; | 559 | urb->error_count = 0; |
561 | urb->status = status; | ||
562 | spin_lock_irqsave(&endp->queue_lock.slock, irqs); | 560 | spin_lock_irqsave(&endp->queue_lock.slock, irqs); |
563 | usb_hcd_unlink_urb_from_ep(hcd, urb); | 561 | usb_hcd_unlink_urb_from_ep(hcd, urb); |
564 | endp->queue_next += 1; | 562 | endp->queue_next += 1; |
@@ -575,7 +573,7 @@ static void u132_hcd_abandon_urb(struct u132 *u132, struct u132_endp *endp, | |||
575 | endp->active = 0; | 573 | endp->active = 0; |
576 | spin_unlock_irqrestore(&endp->queue_lock.slock, irqs); | 574 | spin_unlock_irqrestore(&endp->queue_lock.slock, irqs); |
577 | kfree(urbq); | 575 | kfree(urbq); |
578 | } usb_hcd_giveback_urb(hcd, urb); | 576 | } usb_hcd_giveback_urb(hcd, urb, status); |
579 | return; | 577 | return; |
580 | } | 578 | } |
581 | 579 | ||
@@ -719,7 +717,7 @@ static void u132_hcd_interrupt_recv(void *data, struct urb *urb, u8 *buf, | |||
719 | dev_err(&u132->platform_dev->dev, "CALLBACK called urb=%p " | 717 | dev_err(&u132->platform_dev->dev, "CALLBACK called urb=%p " |
720 | "unlinked=%d\n", urb, urb->unlinked); | 718 | "unlinked=%d\n", urb, urb->unlinked); |
721 | up(&u132->scheduler_lock); | 719 | up(&u132->scheduler_lock); |
722 | u132_hcd_giveback_urb(u132, endp, urb, urb->status); | 720 | u132_hcd_giveback_urb(u132, endp, urb, 0); |
723 | return; | 721 | return; |
724 | } | 722 | } |
725 | } | 723 | } |
@@ -771,7 +769,7 @@ static void u132_hcd_bulk_output_sent(void *data, struct urb *urb, u8 *buf, | |||
771 | dev_err(&u132->platform_dev->dev, "CALLBACK called urb=%p " | 769 | dev_err(&u132->platform_dev->dev, "CALLBACK called urb=%p " |
772 | "unlinked=%d\n", urb, urb->unlinked); | 770 | "unlinked=%d\n", urb, urb->unlinked); |
773 | up(&u132->scheduler_lock); | 771 | up(&u132->scheduler_lock); |
774 | u132_hcd_giveback_urb(u132, endp, urb, urb->status); | 772 | u132_hcd_giveback_urb(u132, endp, urb, 0); |
775 | return; | 773 | return; |
776 | } | 774 | } |
777 | } | 775 | } |
@@ -874,7 +872,7 @@ static void u132_hcd_bulk_input_recv(void *data, struct urb *urb, u8 *buf, | |||
874 | dev_err(&u132->platform_dev->dev, "CALLBACK called urb=%p " | 872 | dev_err(&u132->platform_dev->dev, "CALLBACK called urb=%p " |
875 | "unlinked=%d\n", urb, urb->unlinked); | 873 | "unlinked=%d\n", urb, urb->unlinked); |
876 | up(&u132->scheduler_lock); | 874 | up(&u132->scheduler_lock); |
877 | u132_hcd_giveback_urb(u132, endp, urb, urb->status); | 875 | u132_hcd_giveback_urb(u132, endp, urb, 0); |
878 | return; | 876 | return; |
879 | } | 877 | } |
880 | } | 878 | } |
@@ -911,7 +909,7 @@ static void u132_hcd_configure_empty_sent(void *data, struct urb *urb, u8 *buf, | |||
911 | dev_err(&u132->platform_dev->dev, "CALLBACK called urb=%p " | 909 | dev_err(&u132->platform_dev->dev, "CALLBACK called urb=%p " |
912 | "unlinked=%d\n", urb, urb->unlinked); | 910 | "unlinked=%d\n", urb, urb->unlinked); |
913 | up(&u132->scheduler_lock); | 911 | up(&u132->scheduler_lock); |
914 | u132_hcd_giveback_urb(u132, endp, urb, urb->status); | 912 | u132_hcd_giveback_urb(u132, endp, urb, 0); |
915 | return; | 913 | return; |
916 | } | 914 | } |
917 | } | 915 | } |
@@ -983,7 +981,7 @@ static void u132_hcd_configure_input_recv(void *data, struct urb *urb, u8 *buf, | |||
983 | dev_err(&u132->platform_dev->dev, "CALLBACK called urb=%p " | 981 | dev_err(&u132->platform_dev->dev, "CALLBACK called urb=%p " |
984 | "unlinked=%d\n", urb, urb->unlinked); | 982 | "unlinked=%d\n", urb, urb->unlinked); |
985 | up(&u132->scheduler_lock); | 983 | up(&u132->scheduler_lock); |
986 | u132_hcd_giveback_urb(u132, endp, urb, urb->status); | 984 | u132_hcd_giveback_urb(u132, endp, urb, 0); |
987 | return; | 985 | return; |
988 | } | 986 | } |
989 | } | 987 | } |
@@ -1020,7 +1018,7 @@ static void u132_hcd_configure_empty_recv(void *data, struct urb *urb, u8 *buf, | |||
1020 | dev_err(&u132->platform_dev->dev, "CALLBACK called urb=%p " | 1018 | dev_err(&u132->platform_dev->dev, "CALLBACK called urb=%p " |
1021 | "unlinked=%d\n", urb, urb->unlinked); | 1019 | "unlinked=%d\n", urb, urb->unlinked); |
1022 | up(&u132->scheduler_lock); | 1020 | up(&u132->scheduler_lock); |
1023 | u132_hcd_giveback_urb(u132, endp, urb, urb->status); | 1021 | u132_hcd_giveback_urb(u132, endp, urb, 0); |
1024 | return; | 1022 | return; |
1025 | } | 1023 | } |
1026 | } | 1024 | } |
@@ -1080,7 +1078,7 @@ static void u132_hcd_configure_setup_sent(void *data, struct urb *urb, u8 *buf, | |||
1080 | dev_err(&u132->platform_dev->dev, "CALLBACK called urb=%p " | 1078 | dev_err(&u132->platform_dev->dev, "CALLBACK called urb=%p " |
1081 | "unlinked=%d\n", urb, urb->unlinked); | 1079 | "unlinked=%d\n", urb, urb->unlinked); |
1082 | up(&u132->scheduler_lock); | 1080 | up(&u132->scheduler_lock); |
1083 | u132_hcd_giveback_urb(u132, endp, urb, urb->status); | 1081 | u132_hcd_giveback_urb(u132, endp, urb, 0); |
1084 | return; | 1082 | return; |
1085 | } | 1083 | } |
1086 | } | 1084 | } |
@@ -1121,7 +1119,7 @@ static void u132_hcd_enumeration_empty_recv(void *data, struct urb *urb, | |||
1121 | dev_err(&u132->platform_dev->dev, "CALLBACK called urb=%p " | 1119 | dev_err(&u132->platform_dev->dev, "CALLBACK called urb=%p " |
1122 | "unlinked=%d\n", urb, urb->unlinked); | 1120 | "unlinked=%d\n", urb, urb->unlinked); |
1123 | up(&u132->scheduler_lock); | 1121 | up(&u132->scheduler_lock); |
1124 | u132_hcd_giveback_urb(u132, endp, urb, urb->status); | 1122 | u132_hcd_giveback_urb(u132, endp, urb, 0); |
1125 | return; | 1123 | return; |
1126 | } | 1124 | } |
1127 | } | 1125 | } |
@@ -1165,7 +1163,7 @@ static void u132_hcd_enumeration_address_sent(void *data, struct urb *urb, | |||
1165 | dev_err(&u132->platform_dev->dev, "CALLBACK called urb=%p " | 1163 | dev_err(&u132->platform_dev->dev, "CALLBACK called urb=%p " |
1166 | "unlinked=%d\n", urb, urb->unlinked); | 1164 | "unlinked=%d\n", urb, urb->unlinked); |
1167 | up(&u132->scheduler_lock); | 1165 | up(&u132->scheduler_lock); |
1168 | u132_hcd_giveback_urb(u132, endp, urb, urb->status); | 1166 | u132_hcd_giveback_urb(u132, endp, urb, 0); |
1169 | return; | 1167 | return; |
1170 | } | 1168 | } |
1171 | } | 1169 | } |
@@ -1202,7 +1200,7 @@ static void u132_hcd_initial_empty_sent(void *data, struct urb *urb, u8 *buf, | |||
1202 | dev_err(&u132->platform_dev->dev, "CALLBACK called urb=%p " | 1200 | dev_err(&u132->platform_dev->dev, "CALLBACK called urb=%p " |
1203 | "unlinked=%d\n", urb, urb->unlinked); | 1201 | "unlinked=%d\n", urb, urb->unlinked); |
1204 | up(&u132->scheduler_lock); | 1202 | up(&u132->scheduler_lock); |
1205 | u132_hcd_giveback_urb(u132, endp, urb, urb->status); | 1203 | u132_hcd_giveback_urb(u132, endp, urb, 0); |
1206 | return; | 1204 | return; |
1207 | } | 1205 | } |
1208 | } | 1206 | } |
@@ -1254,7 +1252,7 @@ static void u132_hcd_initial_input_recv(void *data, struct urb *urb, u8 *buf, | |||
1254 | dev_err(&u132->platform_dev->dev, "CALLBACK called urb=%p " | 1252 | dev_err(&u132->platform_dev->dev, "CALLBACK called urb=%p " |
1255 | "unlinked=%d\n", urb, urb->unlinked); | 1253 | "unlinked=%d\n", urb, urb->unlinked); |
1256 | up(&u132->scheduler_lock); | 1254 | up(&u132->scheduler_lock); |
1257 | u132_hcd_giveback_urb(u132, endp, urb, urb->status); | 1255 | u132_hcd_giveback_urb(u132, endp, urb, 0); |
1258 | return; | 1256 | return; |
1259 | } | 1257 | } |
1260 | } | 1258 | } |
@@ -1299,7 +1297,7 @@ static void u132_hcd_initial_setup_sent(void *data, struct urb *urb, u8 *buf, | |||
1299 | dev_err(&u132->platform_dev->dev, "CALLBACK called urb=%p " | 1297 | dev_err(&u132->platform_dev->dev, "CALLBACK called urb=%p " |
1300 | "unlinked=%d\n", urb, urb->unlinked); | 1298 | "unlinked=%d\n", urb, urb->unlinked); |
1301 | up(&u132->scheduler_lock); | 1299 | up(&u132->scheduler_lock); |
1302 | u132_hcd_giveback_urb(u132, endp, urb, urb->status); | 1300 | u132_hcd_giveback_urb(u132, endp, urb, 0); |
1303 | return; | 1301 | return; |
1304 | } | 1302 | } |
1305 | } | 1303 | } |
@@ -2428,7 +2426,7 @@ static int dequeue_from_overflow_chain(struct u132 *u132, | |||
2428 | list_del(scan); | 2426 | list_del(scan); |
2429 | endp->queue_size -= 1; | 2427 | endp->queue_size -= 1; |
2430 | urb->error_count = 0; | 2428 | urb->error_count = 0; |
2431 | usb_hcd_giveback_urb(hcd, urb); | 2429 | usb_hcd_giveback_urb(hcd, urb, 0); |
2432 | return 0; | 2430 | return 0; |
2433 | } else | 2431 | } else |
2434 | continue; | 2432 | continue; |
@@ -2472,7 +2470,7 @@ static int u132_endp_urb_dequeue(struct u132 *u132, struct u132_endp *endp, | |||
2472 | return 0; | 2470 | return 0; |
2473 | } else { | 2471 | } else { |
2474 | spin_unlock_irqrestore(&endp->queue_lock.slock, irqs); | 2472 | spin_unlock_irqrestore(&endp->queue_lock.slock, irqs); |
2475 | u132_hcd_abandon_urb(u132, endp, urb, urb->status); | 2473 | u132_hcd_abandon_urb(u132, endp, urb, status); |
2476 | return 0; | 2474 | return 0; |
2477 | } | 2475 | } |
2478 | } else { | 2476 | } else { |
@@ -2513,7 +2511,7 @@ static int u132_endp_urb_dequeue(struct u132 *u132, struct u132_endp *endp, | |||
2513 | irqs); | 2511 | irqs); |
2514 | kfree(urbq); | 2512 | kfree(urbq); |
2515 | } urb->error_count = 0; | 2513 | } urb->error_count = 0; |
2516 | usb_hcd_giveback_urb(hcd, urb); | 2514 | usb_hcd_giveback_urb(hcd, urb, status); |
2517 | return 0; | 2515 | return 0; |
2518 | } else if (list_empty(&endp->urb_more)) { | 2516 | } else if (list_empty(&endp->urb_more)) { |
2519 | dev_err(&u132->platform_dev->dev, "urb=%p not found in " | 2517 | dev_err(&u132->platform_dev->dev, "urb=%p not found in " |