usb: host: xhci-tegra: otg usb2/usb3 port init
authorJC Kuo <jckuo@nvidia.com>
Tue, 11 Aug 2020 09:31:43 +0000 (17:31 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 18 Aug 2020 11:06:29 +0000 (13:06 +0200)
tegra_xusb_init_usb_phy() should initialize "otg_usb2_port" and
"otg_usb3_port" with -EINVAL because "0" is a valid value
represents usb2 port 0 or usb3 port 0.

Signed-off-by: JC Kuo <jckuo@nvidia.com>
Cc: stable <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20200811093143.699541-1-jckuo@nvidia.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/xhci-tegra.c

index 014d79334f50e1de0390c287b8144a4e0f583fb4..0489a316099a7df2e007a4d5ba311f7bc787e6ad 100644 (file)
@@ -1258,6 +1258,8 @@ static int tegra_xusb_init_usb_phy(struct tegra_xusb *tegra)
 
        INIT_WORK(&tegra->id_work, tegra_xhci_id_work);
        tegra->id_nb.notifier_call = tegra_xhci_id_notify;
+       tegra->otg_usb2_port = -EINVAL;
+       tegra->otg_usb3_port = -EINVAL;
 
        for (i = 0; i < tegra->num_usb_phys; i++) {
                struct phy *phy = tegra_xusb_get_phy(tegra, "usb2", i);