Skip to contentSkip to conversation

usb: xhci: Slightly simplify xhci_set_cmd_ring_deq()

PATCH New Michal Pecio 1 participant 1 message Jul 30

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usb: xhci: Slightly simplify xhci_set_cmd_ring_deq()

There is no need to clear the cycle bit after adding deq_dma, because it's never set there. Clear it together with the dequeue pointer.

---
 drivers/usb/host/xhci.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/usb/host/xhci.c +1 -3
index a58a9a5b487f..dece11ffc0e6 100644
@@ -495,10 +495,8 @@ static void xhci_set_cmd_ring_deq(struct xhci_hcd *xhci)
 	deq_dma &= CMD_RING_PTR_MASK;
 
 	crcr = xhci_read_64(xhci, &xhci->op_regs->cmd_ring);
-	crcr &= ~CMD_RING_PTR_MASK;
+	crcr &= ~(CMD_RING_PTR_MASK | CMD_RING_CYCLE);
 	crcr |= deq_dma;
-
-	crcr &= ~CMD_RING_CYCLE;
 	crcr |= xhci->cmd_ring->cycle_state;
 
 	xhci_dbg_trace(xhci, trace_xhci_dbg_init, "Setting command ring address to 0x%llx", crcr);
Signature · 1 line
2.48.1