bhyve: Use XHCI_PORTREG_PTR in one place that open-coded it.
Reviewed by: corvink, markj Differential Revision: https://reviews.freebsd.org/D36888
This commit is contained in:
parent
57fbafb8de
commit
fd104a6ebc
@ -2130,6 +2130,7 @@ pci_xhci_rtsregs_write(struct pci_xhci_softc *sc, uint64_t offset,
|
||||
static uint64_t
|
||||
pci_xhci_portregs_read(struct pci_xhci_softc *sc, uint64_t offset)
|
||||
{
|
||||
struct pci_xhci_portregs *portregs;
|
||||
int port;
|
||||
uint32_t *p;
|
||||
|
||||
@ -2148,7 +2149,8 @@ pci_xhci_portregs_read(struct pci_xhci_softc *sc, uint64_t offset)
|
||||
|
||||
offset = (offset - 0x3F0) % 0x10;
|
||||
|
||||
p = &sc->portregs[port].portsc;
|
||||
portregs = XHCI_PORTREG_PTR(sc, port);
|
||||
p = &portregs->portsc;
|
||||
p += offset / sizeof(uint32_t);
|
||||
|
||||
DPRINTF(("pci_xhci: portregs read offset 0x%lx port %u -> 0x%x",
|
||||
|
Loading…
Reference in New Issue
Block a user