Skip to content

Commit 1c7f6cd

Browse files
Fabio EstevamFelipe Balbi
authored andcommitted
usb: fsl_mxc_udc.c : Use clk_prepare_enable/clk_disable_unprepare
Prepare the clock before enabling it. Cc: <linux-usb@vger.kernel.org> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Acked-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
1 parent b785ea7 commit 1c7f6cd

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

drivers/usb/gadget/fsl_mxc_udc.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ int fsl_udc_clk_init(struct platform_device *pdev)
4040
if (IS_ERR(mxc_ahb_clk))
4141
return PTR_ERR(mxc_ahb_clk);
4242

43-
ret = clk_enable(mxc_ahb_clk);
43+
ret = clk_prepare_enable(mxc_ahb_clk);
4444
if (ret < 0) {
4545
dev_err(&pdev->dev, "clk_enable(\"usb_ahb\") failed\n");
4646
goto eenahb;
@@ -65,7 +65,7 @@ int fsl_udc_clk_init(struct platform_device *pdev)
6565
}
6666
}
6767

68-
ret = clk_enable(mxc_usb_clk);
68+
ret = clk_prepare_enable(mxc_usb_clk);
6969
if (ret < 0) {
7070
dev_err(&pdev->dev, "clk_enable(\"usb_clk\") failed\n");
7171
goto eenusb;
@@ -79,7 +79,7 @@ int fsl_udc_clk_init(struct platform_device *pdev)
7979
mxc_usb_clk = NULL;
8080
egusb:
8181
if (!cpu_is_mx35())
82-
clk_disable(mxc_ahb_clk);
82+
clk_disable_unprepare(mxc_ahb_clk);
8383
eenahb:
8484
if (!cpu_is_mx35())
8585
clk_put(mxc_ahb_clk);
@@ -104,7 +104,7 @@ void fsl_udc_clk_finalize(struct platform_device *pdev)
104104

105105
/* ULPI transceivers don't need usbpll */
106106
if (pdata->phy_mode == FSL_USB2_PHY_ULPI) {
107-
clk_disable(mxc_usb_clk);
107+
clk_disable_unprepare(mxc_usb_clk);
108108
clk_put(mxc_usb_clk);
109109
mxc_usb_clk = NULL;
110110
}
@@ -113,11 +113,11 @@ void fsl_udc_clk_finalize(struct platform_device *pdev)
113113
void fsl_udc_clk_release(void)
114114
{
115115
if (mxc_usb_clk) {
116-
clk_disable(mxc_usb_clk);
116+
clk_disable_unprepare(mxc_usb_clk);
117117
clk_put(mxc_usb_clk);
118118
}
119119
if (!cpu_is_mx35()) {
120-
clk_disable(mxc_ahb_clk);
120+
clk_disable_unprepare(mxc_ahb_clk);
121121
clk_put(mxc_ahb_clk);
122122
}
123123
}

0 commit comments

Comments
 (0)