[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 04/35] usb/ohci: Move cancelling async packet to ohci_stop_endpoin
From: |
Gerd Hoffmann |
Subject: |
[PULL 04/35] usb/ohci: Move cancelling async packet to ohci_stop_endpoints() |
Date: |
Fri, 4 Mar 2022 15:20:52 +0100 |
From: BALATON Zoltan <balaton@eik.bme.hu>
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>
Message-Id:
<ce766722506bfd7145cccbec750692ff57072280.1643117600.git.balaton@eik.bme.hu>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
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 f915cc547351..6d762973ebd2 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);
}
@@ -1277,10 +1277,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.35.1
- [PULL 00/35] Kraxel 20220304 patches, Gerd Hoffmann, 2022/03/04
- [PULL 01/35] hw/usb: pacify xhciwmi.exe warning, Gerd Hoffmann, 2022/03/04
- [PULL 02/35] hw/usb/dev-mtp: create directories with a+x mode mask, Gerd Hoffmann, 2022/03/04
- [PULL 04/35] usb/ohci: Move cancelling async packet to ohci_stop_endpoints(),
Gerd Hoffmann <=
- [PULL 03/35] usb/ohci: Move trace point and log ep number to help debugging, Gerd Hoffmann, 2022/03/04
- [PULL 05/35] usb/ohci: Move USBPortOps related functions together, Gerd Hoffmann, 2022/03/04
- [PULL 06/35] usb/ohci: Merge ohci_async_cancel_device() into ohci_child_detach(), Gerd Hoffmann, 2022/03/04
- [PULL 08/35] audio: replace open-coded buffer arithmetic, Gerd Hoffmann, 2022/03/04
- [PULL 07/35] usb/ohci: Don't use packet from OHCIState for isochronous transfers, Gerd Hoffmann, 2022/03/04
- [PULL 09/35] audio: move function audio_pcm_hw_clip_out(), Gerd Hoffmann, 2022/03/04
- [PULL 10/35] audio: add function audio_pcm_hw_conv_in(), Gerd Hoffmann, 2022/03/04
- [PULL 12/35] paaudio: increase default latency to 46ms, Gerd Hoffmann, 2022/03/04
- [PULL 11/35] audio: inline function audio_pcm_sw_get_rpos_in(), Gerd Hoffmann, 2022/03/04
- [PULL 13/35] jackaudio: use more jack audio buffers, Gerd Hoffmann, 2022/03/04