1 From be996e1a852397f4009d08ac803081e1dfbc7326 Mon Sep 17 00:00:00 2001
2 From: Gerd Hoffmann <kraxel@redhat.com>
3 Date: Thu, 30 Aug 2012 14:04:04 +0200
4 Subject: [PATCH] xhci: move register update into xhci_intr_raise
6 Now that we have a separate function to raise an IRQ we can move
7 some comon code into the function.
9 Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
11 hw/usb/hcd-xhci.c | 14 +++++---------
12 1 file changed, 5 insertions(+), 9 deletions(-)
14 diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
15 index 777f903..32d22f7 100644
16 --- a/hw/usb/hcd-xhci.c
17 +++ b/hw/usb/hcd-xhci.c
18 @@ -662,8 +662,11 @@ static void xhci_msix_update(XHCIState *xhci)
20 static void xhci_intr_raise(XHCIState *xhci)
22 - if (!(xhci->iman & IMAN_IP) ||
23 - !(xhci->iman & IMAN_IE)) {
24 + xhci->erdp_low |= ERDP_EHB;
25 + xhci->iman |= IMAN_IP;
26 + xhci->usbsts |= USBSTS_EINT;
28 + if (!(xhci->iman & IMAN_IE)) {
32 @@ -784,9 +787,6 @@ static void xhci_events_update(XHCIState *xhci)
36 - xhci->erdp_low |= ERDP_EHB;
37 - xhci->iman |= IMAN_IP;
38 - xhci->usbsts |= USBSTS_EINT;
39 xhci_intr_raise(xhci);
42 @@ -847,10 +847,6 @@ static void xhci_event(XHCIState *xhci, XHCIEvent *event)
43 xhci_write_event(xhci, event);
46 - xhci->erdp_low |= ERDP_EHB;
47 - xhci->iman |= IMAN_IP;
48 - xhci->usbsts |= USBSTS_EINT;
50 xhci_intr_raise(xhci);