summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--hw/usb/hcd-xhci.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
index d00bb0141d..6dfb17cbe9 100644
--- a/hw/usb/hcd-xhci.c
+++ b/hw/usb/hcd-xhci.c
@@ -3010,14 +3010,17 @@ static void xhci_runtime_write(void *ptr, hwaddr reg,
uint64_t val, unsigned size)
{
XHCIState *xhci = ptr;
- int v = (reg - 0x20) / 0x20;
- XHCIInterrupter *intr = &xhci->intr[v];
+ XHCIInterrupter *intr;
+ int v;
+
trace_usb_xhci_runtime_write(reg, val);
if (reg < 0x20) {
trace_usb_xhci_unimplemented("runtime write", reg);
return;
}
+ v = (reg - 0x20) / 0x20;
+ intr = &xhci->intr[v];
switch (reg & 0x1f) {
case 0x00: /* IMAN */