aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-mxc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/rtc/rtc-mxc.c')
-rw-r--r--drivers/rtc/rtc-mxc.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/drivers/rtc/rtc-mxc.c b/drivers/rtc/rtc-mxc.c
index 826ab64a8fa9..d814417bee8c 100644
--- a/drivers/rtc/rtc-mxc.c
+++ b/drivers/rtc/rtc-mxc.c
@@ -418,14 +418,6 @@ static int __init mxc_rtc_probe(struct platform_device *pdev)
418 goto exit_put_clk; 418 goto exit_put_clk;
419 } 419 }
420 420
421 rtc = rtc_device_register(pdev->name, &pdev->dev, &mxc_rtc_ops,
422 THIS_MODULE);
423 if (IS_ERR(rtc)) {
424 ret = PTR_ERR(rtc);
425 goto exit_put_clk;
426 }
427
428 pdata->rtc = rtc;
429 platform_set_drvdata(pdev, pdata); 421 platform_set_drvdata(pdev, pdata);
430 422
431 /* Configure and enable the RTC */ 423 /* Configure and enable the RTC */
@@ -438,8 +430,19 @@ static int __init mxc_rtc_probe(struct platform_device *pdev)
438 pdata->irq = -1; 430 pdata->irq = -1;
439 } 431 }
440 432
433 rtc = rtc_device_register(pdev->name, &pdev->dev, &mxc_rtc_ops,
434 THIS_MODULE);
435 if (IS_ERR(rtc)) {
436 ret = PTR_ERR(rtc);
437 goto exit_clr_drvdata;
438 }
439
440 pdata->rtc = rtc;
441
441 return 0; 442 return 0;
442 443
444exit_clr_drvdata:
445 platform_set_drvdata(pdev, NULL);
443exit_put_clk: 446exit_put_clk:
444 clk_disable(pdata->clk); 447 clk_disable(pdata->clk);
445 clk_put(pdata->clk); 448 clk_put(pdata->clk);