Skip to content

Commit e024854

Browse files
gscuivinodkoul
authored andcommitted
phy: tegra: xusb: Add missing tegra_xusb_port_unregister for usb2_port and ulpi_port
The tegra_xusb_port_unregister should be called when usb2_port and ulpi_port map fails in tegra_xusb_add_usb2_port() or in tegra_xusb_add_ulpi_port(), fix it. Fixes: 53d2a71 ("phy: Add Tegra XUSB pad controller support") Signed-off-by: Gaosheng Cui <[email protected]> Acked-by: Thierry Reding <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent a50abe2 commit e024854

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/phy/tegra/xusb.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -805,6 +805,7 @@ static int tegra_xusb_add_usb2_port(struct tegra_xusb_padctl *padctl,
805805
usb2->base.lane = usb2->base.ops->map(&usb2->base);
806806
if (IS_ERR(usb2->base.lane)) {
807807
err = PTR_ERR(usb2->base.lane);
808+
tegra_xusb_port_unregister(&usb2->base);
808809
goto out;
809810
}
810811

@@ -871,6 +872,7 @@ static int tegra_xusb_add_ulpi_port(struct tegra_xusb_padctl *padctl,
871872
ulpi->base.lane = ulpi->base.ops->map(&ulpi->base);
872873
if (IS_ERR(ulpi->base.lane)) {
873874
err = PTR_ERR(ulpi->base.lane);
875+
tegra_xusb_port_unregister(&ulpi->base);
874876
goto out;
875877
}
876878

0 commit comments

Comments
 (0)