Commit 0f4c3f90 authored by Arvind Yadav's avatar Arvind Yadav Committed by Greg Kroah-Hartman

usb: mtu3: Handle return value of clk_prepare_enable

clk_prepare_enable() can fail here and we must check its return value.
Signed-off-by: default avatarArvind Yadav <arvind.yadav.cs@gmail.com>
Reviewed-by: default avatarMatthias Brugger <matthias.bgg@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b891245b
...@@ -458,6 +458,7 @@ static int __maybe_unused mtu3_resume(struct device *dev) ...@@ -458,6 +458,7 @@ static int __maybe_unused mtu3_resume(struct device *dev)
{ {
struct platform_device *pdev = to_platform_device(dev); struct platform_device *pdev = to_platform_device(dev);
struct ssusb_mtk *ssusb = platform_get_drvdata(pdev); struct ssusb_mtk *ssusb = platform_get_drvdata(pdev);
int ret;
dev_dbg(dev, "%s\n", __func__); dev_dbg(dev, "%s\n", __func__);
...@@ -465,12 +466,28 @@ static int __maybe_unused mtu3_resume(struct device *dev) ...@@ -465,12 +466,28 @@ static int __maybe_unused mtu3_resume(struct device *dev)
return 0; return 0;
ssusb_wakeup_disable(ssusb); ssusb_wakeup_disable(ssusb);
clk_prepare_enable(ssusb->sys_clk); ret = clk_prepare_enable(ssusb->sys_clk);
clk_prepare_enable(ssusb->ref_clk); if (ret)
ssusb_phy_power_on(ssusb); goto err_sys_clk;
ret = clk_prepare_enable(ssusb->ref_clk);
if (ret)
goto err_ref_clk;
ret = ssusb_phy_power_on(ssusb);
if (ret)
goto err_power_on;
ssusb_host_enable(ssusb); ssusb_host_enable(ssusb);
return 0; return 0;
err_power_on:
clk_disable_unprepare(ssusb->ref_clk);
err_ref_clk:
clk_disable_unprepare(ssusb->sys_clk);
err_sys_clk:
return ret;
} }
static const struct dev_pm_ops mtu3_pm_ops = { static const struct dev_pm_ops mtu3_pm_ops = {
......
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