Commit a9f17d0c authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Vinod Koul

phy: ti: tusb1210: Fix an error handling path in tusb1210_probe()

tusb1210_probe_charger_detect() must be undone by a corresponding
tusb1210_remove_charger_detect() in the error handling path, as already
done in the remove function.

Fixes: 48969a56 ("phy: ti: tusb1210: Add charger detection")
Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/07c4926c42243cedb3b6067a241bb486fdda01b5.1648991162.git.christophe.jaillet@wanadoo.frSigned-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent 5c8402c4
...@@ -537,12 +537,18 @@ static int tusb1210_probe(struct ulpi *ulpi) ...@@ -537,12 +537,18 @@ static int tusb1210_probe(struct ulpi *ulpi)
tusb1210_probe_charger_detect(tusb); tusb1210_probe_charger_detect(tusb);
tusb->phy = ulpi_phy_create(ulpi, &phy_ops); tusb->phy = ulpi_phy_create(ulpi, &phy_ops);
if (IS_ERR(tusb->phy)) if (IS_ERR(tusb->phy)) {
return PTR_ERR(tusb->phy); ret = PTR_ERR(tusb->phy);
goto err_remove_charger;
}
phy_set_drvdata(tusb->phy, tusb); phy_set_drvdata(tusb->phy, tusb);
ulpi_set_drvdata(ulpi, tusb); ulpi_set_drvdata(ulpi, tusb);
return 0; return 0;
err_remove_charger:
tusb1210_remove_charger_detect(tusb);
return ret;
} }
static void tusb1210_remove(struct ulpi *ulpi) static void tusb1210_remove(struct ulpi *ulpi)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment