Commit ece7af5f authored by Arvind Yadav's avatar Arvind Yadav Committed by Felipe Balbi

usb: dwc3: exynos: Handle return value of clk_prepare_enable

clk_prepare_enable() can fail here and we must check its return value.
Reviewed-by: default avatarKrzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: default avatarArvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
parent 0e1b89e5
...@@ -125,12 +125,16 @@ static int dwc3_exynos_probe(struct platform_device *pdev) ...@@ -125,12 +125,16 @@ static int dwc3_exynos_probe(struct platform_device *pdev)
dev_err(dev, "couldn't get clock\n"); dev_err(dev, "couldn't get clock\n");
return -EINVAL; return -EINVAL;
} }
clk_prepare_enable(exynos->clk); ret = clk_prepare_enable(exynos->clk);
if (ret)
return ret;
exynos->susp_clk = devm_clk_get(dev, "usbdrd30_susp_clk"); exynos->susp_clk = devm_clk_get(dev, "usbdrd30_susp_clk");
if (IS_ERR(exynos->susp_clk)) if (IS_ERR(exynos->susp_clk))
exynos->susp_clk = NULL; exynos->susp_clk = NULL;
clk_prepare_enable(exynos->susp_clk); ret = clk_prepare_enable(exynos->susp_clk);
if (ret)
goto susp_clk_err;
if (of_device_is_compatible(node, "samsung,exynos7-dwusb3")) { if (of_device_is_compatible(node, "samsung,exynos7-dwusb3")) {
exynos->axius_clk = devm_clk_get(dev, "usbdrd30_axius_clk"); exynos->axius_clk = devm_clk_get(dev, "usbdrd30_axius_clk");
...@@ -139,7 +143,9 @@ static int dwc3_exynos_probe(struct platform_device *pdev) ...@@ -139,7 +143,9 @@ static int dwc3_exynos_probe(struct platform_device *pdev)
ret = -ENODEV; ret = -ENODEV;
goto axius_clk_err; goto axius_clk_err;
} }
clk_prepare_enable(exynos->axius_clk); ret = clk_prepare_enable(exynos->axius_clk);
if (ret)
goto axius_clk_err;
} else { } else {
exynos->axius_clk = NULL; exynos->axius_clk = NULL;
} }
...@@ -197,6 +203,7 @@ static int dwc3_exynos_probe(struct platform_device *pdev) ...@@ -197,6 +203,7 @@ static int dwc3_exynos_probe(struct platform_device *pdev)
clk_disable_unprepare(exynos->axius_clk); clk_disable_unprepare(exynos->axius_clk);
axius_clk_err: axius_clk_err:
clk_disable_unprepare(exynos->susp_clk); clk_disable_unprepare(exynos->susp_clk);
susp_clk_err:
clk_disable_unprepare(exynos->clk); clk_disable_unprepare(exynos->clk);
return ret; return ret;
} }
......
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