aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/host/fsl-mph-dr-of.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/usb/host/fsl-mph-dr-of.c b/drivers/usb/host/fsl-mph-dr-of.c
index cfbff7161828..9e0020d9e4c8 100644
--- a/drivers/usb/host/fsl-mph-dr-of.c
+++ b/drivers/usb/host/fsl-mph-dr-of.c
@@ -260,6 +260,7 @@ int fsl_usb2_mpc5121_init(struct platform_device *pdev)
260{ 260{
261 struct fsl_usb2_platform_data *pdata = dev_get_platdata(&pdev->dev); 261 struct fsl_usb2_platform_data *pdata = dev_get_platdata(&pdev->dev);
262 struct clk *clk; 262 struct clk *clk;
263 int err;
263 char clk_name[10]; 264 char clk_name[10];
264 int base, clk_num; 265 int base, clk_num;
265 266
@@ -272,13 +273,16 @@ int fsl_usb2_mpc5121_init(struct platform_device *pdev)
272 return -ENODEV; 273 return -ENODEV;
273 274
274 snprintf(clk_name, sizeof(clk_name), "usb%d_clk", clk_num); 275 snprintf(clk_name, sizeof(clk_name), "usb%d_clk", clk_num);
275 clk = clk_get(&pdev->dev, clk_name); 276 clk = devm_clk_get(pdev->dev.parent, clk_name);
276 if (IS_ERR(clk)) { 277 if (IS_ERR(clk)) {
277 dev_err(&pdev->dev, "failed to get clk\n"); 278 dev_err(&pdev->dev, "failed to get clk\n");
278 return PTR_ERR(clk); 279 return PTR_ERR(clk);
279 } 280 }
280 281 err = clk_prepare_enable(clk);
281 clk_enable(clk); 282 if (err) {
283 dev_err(&pdev->dev, "failed to enable clk\n");
284 return err;
285 }
282 pdata->clk = clk; 286 pdata->clk = clk;
283 287
284 if (pdata->phy_mode == FSL_USB2_PHY_UTMI_WIDE) { 288 if (pdata->phy_mode == FSL_USB2_PHY_UTMI_WIDE) {
@@ -302,10 +306,8 @@ static void fsl_usb2_mpc5121_exit(struct platform_device *pdev)
302 306
303 pdata->regs = NULL; 307 pdata->regs = NULL;
304 308
305 if (pdata->clk) { 309 if (pdata->clk)
306 clk_disable(pdata->clk); 310 clk_disable_unprepare(pdata->clk);
307 clk_put(pdata->clk);
308 }
309} 311}
310 312
311static struct fsl_usb2_platform_data fsl_usb2_mpc5121_pd = { 313static struct fsl_usb2_platform_data fsl_usb2_mpc5121_pd = {