aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJingoo Han <jg1.han@samsung.com>2013-04-29 19:19:19 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-04-29 21:28:27 -0400
commitbc862f44cb49f401b05d7fc2a400209c97535a28 (patch)
treecd54a444084a3a9082ed254f38cdd568b876fd2d
parentbc2e9c0b29be813f90e26161a1cc4eeafa4582b7 (diff)
rtc: rtc-wm831x: 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-wm831x.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/rtc/rtc-wm831x.c b/drivers/rtc/rtc-wm831x.c
index 2f0ac7b30a0c..8d65b94e5a7e 100644
--- a/drivers/rtc/rtc-wm831x.c
+++ b/drivers/rtc/rtc-wm831x.c
@@ -436,7 +436,7 @@ static int wm831x_rtc_probe(struct platform_device *pdev)
436 436
437 device_init_wakeup(&pdev->dev, 1); 437 device_init_wakeup(&pdev->dev, 1);
438 438
439 wm831x_rtc->rtc = rtc_device_register("wm831x", &pdev->dev, 439 wm831x_rtc->rtc = devm_rtc_device_register(&pdev->dev, "wm831x",
440 &wm831x_rtc_ops, THIS_MODULE); 440 &wm831x_rtc_ops, THIS_MODULE);
441 if (IS_ERR(wm831x_rtc->rtc)) { 441 if (IS_ERR(wm831x_rtc->rtc)) {
442 ret = PTR_ERR(wm831x_rtc->rtc); 442 ret = PTR_ERR(wm831x_rtc->rtc);
@@ -462,10 +462,6 @@ err:
462 462
463static int wm831x_rtc_remove(struct platform_device *pdev) 463static int wm831x_rtc_remove(struct platform_device *pdev)
464{ 464{
465 struct wm831x_rtc *wm831x_rtc = platform_get_drvdata(pdev);
466
467 rtc_device_unregister(wm831x_rtc->rtc);
468
469 return 0; 465 return 0;
470} 466}
471 467