Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

usb/acpi: binding xhci root hub usb port with ACPI

This patch is to bind xhci root hub usb port with its acpi node.
The port num in the acpi table matches with the sequence in the xhci
extended capabilities table. So call usb_hcd_find_raw_port_number() to
transfer hub port num into raw port number which associates with
the sequence in the xhci extended capabilities table before binding.

Signed-off-by: Lan Tianyu <tianyu.lan@intel.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>

authored by

Lan Tianyu and committed by
Sarah Sharp
bafcaf6d 3f5eb141

+7 -1
+7 -1
drivers/usb/core/usb-acpi.c
··· 15 15 #include <linux/kernel.h> 16 16 #include <linux/acpi.h> 17 17 #include <linux/pci.h> 18 + #include <linux/usb/hcd.h> 18 19 #include <acpi/acpi_bus.h> 19 20 20 21 #include "usb.h" ··· 189 188 * connected to. 190 189 */ 191 190 if (!udev->parent) { 192 - *handle = acpi_get_child(DEVICE_ACPI_HANDLE(&udev->dev), 191 + struct usb_hcd *hcd = bus_to_hcd(udev->bus); 192 + int raw_port_num; 193 + 194 + raw_port_num = usb_hcd_find_raw_port_number(hcd, 193 195 port_num); 196 + *handle = acpi_get_child(DEVICE_ACPI_HANDLE(&udev->dev), 197 + raw_port_num); 194 198 if (!*handle) 195 199 return -ENODEV; 196 200 } else {