aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJingoo Han <jg1.han@samsung.com>2013-04-29 19:19:08 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-04-29 21:28:26 -0400
commit4241e2b81cf6458169f25b3f40cff33b497b2339 (patch)
treefe68bfcab2d7a7908d7ef370b56b9f78b191aafb
parent4ce903cc91534916a3b342bae91c30ba777190fd (diff)
rtc: rtc-mv: use devm_rtc_device_register()
devm_rtc_device_register() is device managed and makes cleanup paths simpler. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--drivers/rtc/rtc-mv.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/rtc/rtc-mv.c b/drivers/rtc/rtc-mv.c
index f378e1773a3e..baab802f2153 100644
--- a/drivers/rtc/rtc-mv.c
+++ b/drivers/rtc/rtc-mv.c
@@ -272,12 +272,13 @@ static int __init mv_rtc_probe(struct platform_device *pdev)
272 272
273 if (pdata->irq >= 0) { 273 if (pdata->irq >= 0) {
274 device_init_wakeup(&pdev->dev, 1); 274 device_init_wakeup(&pdev->dev, 1);
275 pdata->rtc = rtc_device_register(pdev->name, &pdev->dev, 275 pdata->rtc = devm_rtc_device_register(&pdev->dev, pdev->name,
276 &mv_rtc_alarm_ops, 276 &mv_rtc_alarm_ops,
277 THIS_MODULE); 277 THIS_MODULE);
278 } else 278 } else {
279 pdata->rtc = rtc_device_register(pdev->name, &pdev->dev, 279 pdata->rtc = devm_rtc_device_register(&pdev->dev, pdev->name,
280 &mv_rtc_ops, THIS_MODULE); 280 &mv_rtc_ops, THIS_MODULE);
281 }
281 if (IS_ERR(pdata->rtc)) { 282 if (IS_ERR(pdata->rtc)) {
282 ret = PTR_ERR(pdata->rtc); 283 ret = PTR_ERR(pdata->rtc);
283 goto out; 284 goto out;
@@ -308,7 +309,6 @@ static int __exit mv_rtc_remove(struct platform_device *pdev)
308 if (pdata->irq >= 0) 309 if (pdata->irq >= 0)
309 device_init_wakeup(&pdev->dev, 0); 310 device_init_wakeup(&pdev->dev, 0);
310 311
311 rtc_device_unregister(pdata->rtc);
312 if (!IS_ERR(pdata->clk)) 312 if (!IS_ERR(pdata->clk))
313 clk_disable_unprepare(pdata->clk); 313 clk_disable_unprepare(pdata->clk);
314 314