2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-20 11:13:58 +08:00

xhci-mtk: use xhci hub structures to get number of ports in roothubs

Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Mathias Nyman 2018-05-21 16:40:03 +03:00 committed by Greg Kroah-Hartman
parent 925f349d4d
commit edaa30f878

View File

@ -58,7 +58,7 @@ static int get_bw_index(struct xhci_hcd *xhci, struct usb_device *udev,
bw_index = (virt_dev->real_port - 1) * 2 + 1; bw_index = (virt_dev->real_port - 1) * 2 + 1;
} else { } else {
/* add one more for each SS port */ /* add one more for each SS port */
bw_index = virt_dev->real_port + xhci->num_usb3_ports - 1; bw_index = virt_dev->real_port + xhci->usb3_rhub.num_ports - 1;
} }
return bw_index; return bw_index;
@ -284,7 +284,7 @@ int xhci_mtk_sch_init(struct xhci_hcd_mtk *mtk)
int i; int i;
/* ss IN and OUT are separated */ /* ss IN and OUT are separated */
num_usb_bus = xhci->num_usb3_ports * 2 + xhci->num_usb2_ports; num_usb_bus = xhci->usb3_rhub.num_ports * 2 + xhci->usb2_rhub.num_ports;
sch_array = kcalloc(num_usb_bus, sizeof(*sch_array), GFP_KERNEL); sch_array = kcalloc(num_usb_bus, sizeof(*sch_array), GFP_KERNEL);
if (sch_array == NULL) if (sch_array == NULL)