From: Martin Blumenstingl Date: Tue, 26 May 2020 20:29:42 +0000 (+0200) Subject: usb: dwc3: meson-g12a: fix error path when fetching the reset line fails X-Git-Tag: v5.7.6~179 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=0ff9a6d7c502b33a662fe360701ff4b203e6df86;p=users%2Fdwmw2%2Flinux.git usb: dwc3: meson-g12a: fix error path when fetching the reset line fails [ Upstream commit be8c1001a7e681e8813882a42ed51c8dbffd8800 ] Disable and unprepare the clocks when devm_reset_control_get_shared() fails. This fixes the error path as this must disable the clocks which were previously enabled. Fixes: 1e355f21d3fb96 ("usb: dwc3: Add Amlogic A1 DWC3 glue") Cc: Yue Wang Cc: Hanjie Lin Acked-by: Neil Armstrong Signed-off-by: Martin Blumenstingl Link: https://lore.kernel.org/r/20200526202943.715220-2-martin.blumenstingl@googlemail.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- diff --git a/drivers/usb/dwc3/dwc3-meson-g12a.c b/drivers/usb/dwc3/dwc3-meson-g12a.c index 2d257bdfe8485..eabb3bb6fcaa1 100644 --- a/drivers/usb/dwc3/dwc3-meson-g12a.c +++ b/drivers/usb/dwc3/dwc3-meson-g12a.c @@ -505,7 +505,7 @@ static int dwc3_meson_g12a_probe(struct platform_device *pdev) if (IS_ERR(priv->reset)) { ret = PTR_ERR(priv->reset); dev_err(dev, "failed to get device reset, err=%d\n", ret); - return ret; + goto err_disable_clks; } ret = reset_control_reset(priv->reset);