Commit 240b65dc authored by Andrey Smirnov's avatar Andrey Smirnov Committed by Felipe Balbi

usb: dwc3: Use clk_bulk_prepare_enable()

Use clk_bulk_prepare_enable() and clk_bulk_disable_unprepare() to
simplify code a bit. No functional change intended.
Signed-off-by: default avatarAndrey Smirnov <andrew.smirnov@gmail.com>
Cc: Felipe Balbi <balbi@kernel.org>
Cc: Chris Healy <cphealy@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-usb@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
parent 03bf32bb
...@@ -699,8 +699,7 @@ static void dwc3_core_exit(struct dwc3 *dwc) ...@@ -699,8 +699,7 @@ static void dwc3_core_exit(struct dwc3 *dwc)
usb_phy_set_suspend(dwc->usb3_phy, 1); usb_phy_set_suspend(dwc->usb3_phy, 1);
phy_power_off(dwc->usb2_generic_phy); phy_power_off(dwc->usb2_generic_phy);
phy_power_off(dwc->usb3_generic_phy); phy_power_off(dwc->usb3_generic_phy);
clk_bulk_disable(dwc->num_clks, dwc->clks); clk_bulk_disable_unprepare(dwc->num_clks, dwc->clks);
clk_bulk_unprepare(dwc->num_clks, dwc->clks);
reset_control_assert(dwc->reset); reset_control_assert(dwc->reset);
} }
...@@ -1463,14 +1462,10 @@ static int dwc3_probe(struct platform_device *pdev) ...@@ -1463,14 +1462,10 @@ static int dwc3_probe(struct platform_device *pdev)
if (ret) if (ret)
return ret; return ret;
ret = clk_bulk_prepare(dwc->num_clks, dwc->clks); ret = clk_bulk_prepare_enable(dwc->num_clks, dwc->clks);
if (ret) if (ret)
goto assert_reset; goto assert_reset;
ret = clk_bulk_enable(dwc->num_clks, dwc->clks);
if (ret)
goto unprepare_clks;
if (!dwc3_core_is_valid(dwc)) { if (!dwc3_core_is_valid(dwc)) {
dev_err(dwc->dev, "this is not a DesignWare USB3 DRD Core\n"); dev_err(dwc->dev, "this is not a DesignWare USB3 DRD Core\n");
ret = -ENODEV; ret = -ENODEV;
...@@ -1543,9 +1538,7 @@ static int dwc3_probe(struct platform_device *pdev) ...@@ -1543,9 +1538,7 @@ static int dwc3_probe(struct platform_device *pdev)
pm_runtime_disable(&pdev->dev); pm_runtime_disable(&pdev->dev);
disable_clks: disable_clks:
clk_bulk_disable(dwc->num_clks, dwc->clks); clk_bulk_disable_unprepare(dwc->num_clks, dwc->clks);
unprepare_clks:
clk_bulk_unprepare(dwc->num_clks, dwc->clks);
assert_reset: assert_reset:
reset_control_assert(dwc->reset); reset_control_assert(dwc->reset);
...@@ -1583,14 +1576,10 @@ static int dwc3_core_init_for_resume(struct dwc3 *dwc) ...@@ -1583,14 +1576,10 @@ static int dwc3_core_init_for_resume(struct dwc3 *dwc)
if (ret) if (ret)
return ret; return ret;
ret = clk_bulk_prepare(dwc->num_clks, dwc->clks); ret = clk_bulk_prepare_enable(dwc->num_clks, dwc->clks);
if (ret) if (ret)
goto assert_reset; goto assert_reset;
ret = clk_bulk_enable(dwc->num_clks, dwc->clks);
if (ret)
goto unprepare_clks;
ret = dwc3_core_init(dwc); ret = dwc3_core_init(dwc);
if (ret) if (ret)
goto disable_clks; goto disable_clks;
...@@ -1598,9 +1587,7 @@ static int dwc3_core_init_for_resume(struct dwc3 *dwc) ...@@ -1598,9 +1587,7 @@ static int dwc3_core_init_for_resume(struct dwc3 *dwc)
return 0; return 0;
disable_clks: disable_clks:
clk_bulk_disable(dwc->num_clks, dwc->clks); clk_bulk_disable_unprepare(dwc->num_clks, dwc->clks);
unprepare_clks:
clk_bulk_unprepare(dwc->num_clks, dwc->clks);
assert_reset: assert_reset:
reset_control_assert(dwc->reset); reset_control_assert(dwc->reset);
......
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