aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget
diff options
context:
space:
mode:
authorFabio Estevam <fabio.estevam@freescale.com>2012-05-25 19:14:53 -0400
committerFelipe Balbi <balbi@ti.com>2012-06-12 06:30:48 -0400
commit1c7f6cd3f97b038e875094a8433e239f03d10955 (patch)
tree4df9ddd91c2355abfe636f7546bcd744314c2ca3 /drivers/usb/gadget
parentb785ea7ce662c47f6208071320638a4813722803 (diff)
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>
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r--drivers/usb/gadget/fsl_mxc_udc.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/usb/gadget/fsl_mxc_udc.c b/drivers/usb/gadget/fsl_mxc_udc.c
index dcbc0a2e48dd..f4b5109feb3d 100644
--- a/drivers/usb/gadget/fsl_mxc_udc.c
+++ b/drivers/usb/gadget/fsl_mxc_udc.c
@@ -40,7 +40,7 @@ int fsl_udc_clk_init(struct platform_device *pdev)
40 if (IS_ERR(mxc_ahb_clk)) 40 if (IS_ERR(mxc_ahb_clk))
41 return PTR_ERR(mxc_ahb_clk); 41 return PTR_ERR(mxc_ahb_clk);
42 42
43 ret = clk_enable(mxc_ahb_clk); 43 ret = clk_prepare_enable(mxc_ahb_clk);
44 if (ret < 0) { 44 if (ret < 0) {
45 dev_err(&pdev->dev, "clk_enable(\"usb_ahb\") failed\n"); 45 dev_err(&pdev->dev, "clk_enable(\"usb_ahb\") failed\n");
46 goto eenahb; 46 goto eenahb;
@@ -65,7 +65,7 @@ int fsl_udc_clk_init(struct platform_device *pdev)
65 } 65 }
66 } 66 }
67 67
68 ret = clk_enable(mxc_usb_clk); 68 ret = clk_prepare_enable(mxc_usb_clk);
69 if (ret < 0) { 69 if (ret < 0) {
70 dev_err(&pdev->dev, "clk_enable(\"usb_clk\") failed\n"); 70 dev_err(&pdev->dev, "clk_enable(\"usb_clk\") failed\n");
71 goto eenusb; 71 goto eenusb;
@@ -79,7 +79,7 @@ eclkrate:
79 mxc_usb_clk = NULL; 79 mxc_usb_clk = NULL;
80egusb: 80egusb:
81 if (!cpu_is_mx35()) 81 if (!cpu_is_mx35())
82 clk_disable(mxc_ahb_clk); 82 clk_disable_unprepare(mxc_ahb_clk);
83eenahb: 83eenahb:
84 if (!cpu_is_mx35()) 84 if (!cpu_is_mx35())
85 clk_put(mxc_ahb_clk); 85 clk_put(mxc_ahb_clk);
@@ -104,7 +104,7 @@ void fsl_udc_clk_finalize(struct platform_device *pdev)
104 104
105 /* ULPI transceivers don't need usbpll */ 105 /* ULPI transceivers don't need usbpll */
106 if (pdata->phy_mode == FSL_USB2_PHY_ULPI) { 106 if (pdata->phy_mode == FSL_USB2_PHY_ULPI) {
107 clk_disable(mxc_usb_clk); 107 clk_disable_unprepare(mxc_usb_clk);
108 clk_put(mxc_usb_clk); 108 clk_put(mxc_usb_clk);
109 mxc_usb_clk = NULL; 109 mxc_usb_clk = NULL;
110 } 110 }
@@ -113,11 +113,11 @@ void fsl_udc_clk_finalize(struct platform_device *pdev)
113void fsl_udc_clk_release(void) 113void fsl_udc_clk_release(void)
114{ 114{
115 if (mxc_usb_clk) { 115 if (mxc_usb_clk) {
116 clk_disable(mxc_usb_clk); 116 clk_disable_unprepare(mxc_usb_clk);
117 clk_put(mxc_usb_clk); 117 clk_put(mxc_usb_clk);
118 } 118 }
119 if (!cpu_is_mx35()) { 119 if (!cpu_is_mx35()) {
120 clk_disable(mxc_ahb_clk); 120 clk_disable_unprepare(mxc_ahb_clk);
121 clk_put(mxc_ahb_clk); 121 clk_put(mxc_ahb_clk);
122 } 122 }
123} 123}