aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/rtc/rtc-mv.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/drivers/rtc/rtc-mv.c b/drivers/rtc/rtc-mv.c
index 1e8451763832..7c0cf532a18d 100644
--- a/drivers/rtc/rtc-mv.c
+++ b/drivers/rtc/rtc-mv.c
@@ -254,15 +254,7 @@ static int __init mv_rtc_probe(struct platform_device *pdev)
254 254
255 platform_set_drvdata(pdev, pdata); 255 platform_set_drvdata(pdev, pdata);
256 256
257 if (pdata->irq >= 0) { 257 pdata->rtc = devm_rtc_allocate_device(&pdev->dev);
258 device_init_wakeup(&pdev->dev, 1);
259 pdata->rtc = devm_rtc_device_register(&pdev->dev, pdev->name,
260 &mv_rtc_alarm_ops,
261 THIS_MODULE);
262 } else {
263 pdata->rtc = devm_rtc_device_register(&pdev->dev, pdev->name,
264 &mv_rtc_ops, THIS_MODULE);
265 }
266 if (IS_ERR(pdata->rtc)) { 258 if (IS_ERR(pdata->rtc)) {
267 ret = PTR_ERR(pdata->rtc); 259 ret = PTR_ERR(pdata->rtc);
268 goto out; 260 goto out;
@@ -278,7 +270,16 @@ static int __init mv_rtc_probe(struct platform_device *pdev)
278 } 270 }
279 } 271 }
280 272
281 return 0; 273 if (pdata->irq >= 0) {
274 device_init_wakeup(&pdev->dev, 1);
275 pdata->rtc->ops = &mv_rtc_alarm_ops;
276 } else {
277 pdata->rtc->ops = &mv_rtc_ops;
278 }
279
280 ret = rtc_register_device(pdata->rtc);
281 if (!ret)
282 return 0;
282out: 283out:
283 if (!IS_ERR(pdata->clk)) 284 if (!IS_ERR(pdata->clk))
284 clk_disable_unprepare(pdata->clk); 285 clk_disable_unprepare(pdata->clk);