[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH 1/4] usb/ohci: Move cancelling async packet to ohci_stop_endp
From: |
BALATON Zoltan |
Subject: |
[RFC PATCH 1/4] usb/ohci: Move cancelling async packet to ohci_stop_endpoints() |
Date: |
Fri, 01 Oct 2021 23:11:10 +0200 |
This is always done before calling this function so remove duplicated
code and do it within the function at one place.
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
---
hw/usb/hcd-ohci.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/hw/usb/hcd-ohci.c b/hw/usb/hcd-ohci.c
index 1cf2816772..405abbb62d 100644
--- a/hw/usb/hcd-ohci.c
+++ b/hw/usb/hcd-ohci.c
@@ -369,6 +369,10 @@ void ohci_stop_endpoints(OHCIState *ohci)
USBDevice *dev;
int i, j;
+ if (ohci->async_td) {
+ usb_cancel_packet(&ohci->usb_packet);
+ ohci->async_td = 0;
+ }
for (i = 0; i < ohci->num_ports; i++) {
dev = ohci->rhport[i].port.dev;
if (dev && dev->attached) {
@@ -398,10 +402,6 @@ static void ohci_roothub_reset(OHCIState *ohci)
usb_port_reset(&port->port);
}
}
- if (ohci->async_td) {
- usb_cancel_packet(&ohci->usb_packet);
- ohci->async_td = 0;
- }
ohci_stop_endpoints(ohci);
}
@@ -1271,10 +1271,6 @@ static void ohci_frame_boundary(void *opaque)
/* Cancel all pending packets if either of the lists has been disabled. */
if (ohci->old_ctl & (~ohci->ctl) & (OHCI_CTL_BLE | OHCI_CTL_CLE)) {
- if (ohci->async_td) {
- usb_cancel_packet(&ohci->usb_packet);
- ohci->async_td = 0;
- }
ohci_stop_endpoints(ohci);
}
ohci->old_ctl = ohci->ctl;
--
2.21.4
- [RFC PATCH 0/4] Misc OHCI patches, BALATON Zoltan, 2021/10/01
- [RFC PATCH 4/4] usb/ohci: Don't use packet from OHCIState for isochronous transfers, BALATON Zoltan, 2021/10/01
- [RFC PATCH 1/4] usb/ohci: Move cancelling async packet to ohci_stop_endpoints(),
BALATON Zoltan <=
- [RFC PATCH 2/4] usb/ohci: Move USBPortOps related functions together, BALATON Zoltan, 2021/10/01
- [RFC PATCH 3/4] usb/ohci: Merge ohci_async_cancel_device() into ohci_child_detach(), BALATON Zoltan, 2021/10/01
- Re: [RFC PATCH 0/4] Misc OHCI patches, Howard Spoelstra, 2021/10/02
- Re: [RFC PATCH 0/4] Misc OHCI patches, BALATON Zoltan, 2021/10/02
- Re: [RFC PATCH 0/4] Misc OHCI patches, BALATON Zoltan, 2021/10/02
- Re: [RFC PATCH 0/4] Misc OHCI patches, Howard Spoelstra, 2021/10/03
- Re: [RFC PATCH 0/4] Misc OHCI patches, BALATON Zoltan, 2021/10/03
- Re: [RFC PATCH 0/4] Misc OHCI patches, Howard Spoelstra, 2021/10/03
- Re: [RFC PATCH 0/4] Misc OHCI patches, Howard Spoelstra, 2021/10/04
- Re: [RFC PATCH 0/4] Misc OHCI patches, BALATON Zoltan, 2021/10/04