usb: xhci: convert to HCS_MAX_PORTS()

Use HCS_MAX_PORTS(p) instead of
((p & HCS_MAX_PORTS_MASK) >> HCS_MAX_PORTS_SHIFT)

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
This commit is contained in:
Chunfeng Yun
2020-09-08 18:59:58 +02:00
committed by Marek Vasut
parent 740820519c
commit 86d1fa17fb
2 changed files with 1 additions and 4 deletions

View File

@@ -1257,8 +1257,7 @@ static int xhci_lowlevel_init(struct xhci_ctrl *ctrl)
return -ENOMEM;
reg = xhci_readl(&hccr->cr_hcsparams1);
descriptor.hub.bNbrPorts = ((reg & HCS_MAX_PORTS_MASK) >>
HCS_MAX_PORTS_SHIFT);
descriptor.hub.bNbrPorts = HCS_MAX_PORTS(reg);
printf("Register %x NbrPorts %d\n", reg, descriptor.hub.bNbrPorts);
/* Port Indicators */