]> git.baikalelectronics.ru Git - kernel.git/commit
usb: dwc3: Try usb-role-switch first in dwc3_drd_init
authorSven Peter <sven@svenpeter.dev>
Mon, 11 Apr 2022 15:53:00 +0000 (17:53 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 21 Apr 2022 17:08:13 +0000 (19:08 +0200)
commit34175f971a8c5eb1dd97ef6f042ee8ec916889da
tree43afa984ff8d44b973e2f75c764cbdc848d56f81
parent51169a9041004c86b0ec8094a20964f64219fbd2
usb: dwc3: Try usb-role-switch first in dwc3_drd_init

If the PHY controller node has a "port" dwc3 tries to find an
extcon device even when "usb-role-switch" is present. This happens
because dwc3_get_extcon() sees that "port" node and then calls
extcon_find_edev_by_node() which will always return EPROBE_DEFER
in that case.

On the other hand, even if an extcon was present and dwc3_get_extcon()
was successful it would still be ignored in favor of "usb-role-switch".

Let's just first check if "usb-role-switch" is configured in the device
tree and directly use it instead and only try to look for an extcon
device otherwise.

Fixes: 5bc23a709b51 ("usb: dwc3: Registering a role switch in the DRD code.")
Cc: stable <stable@kernel.org>
Signed-off-by: Sven Peter <sven@svenpeter.dev>
Link: https://lore.kernel.org/r/20220411155300.9766-1-sven@svenpeter.dev
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/dwc3/drd.c