提交 f7ffaa6f 编写于 作者: H Heikki Krogerus 提交者: Greg Kroah-Hartman

usb: core: acpi: Use the sysdev pointer instead of controller device

The controller device (hcd) does not always have the ACPI
companion assigned to it at all. We can not rely on it when
finding the ACPI companion for the root hub. Instead we need
to use the sysdev pointer.
Signed-off-by: NHeikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20220428111056.3558-2-heikki.krogerus@linux.intel.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 9a922c04
...@@ -205,8 +205,11 @@ usb_acpi_find_companion_for_device(struct usb_device *udev) ...@@ -205,8 +205,11 @@ usb_acpi_find_companion_for_device(struct usb_device *udev)
struct usb_hub *hub; struct usb_hub *hub;
if (!udev->parent) { if (!udev->parent) {
/* root hub is only child (_ADR=0) under its parent, the HC */ /*
adev = ACPI_COMPANION(udev->dev.parent); * root hub is only child (_ADR=0) under its parent, the HC.
* sysdev pointer is the HC as seen from firmware.
*/
adev = ACPI_COMPANION(udev->bus->sysdev);
return acpi_find_child_device(adev, 0, false); return acpi_find_child_device(adev, 0, false);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册