diff options
author | Jingoo Han <jg1.han@samsung.com> | 2013-04-29 19:19:11 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-04-29 21:28:27 -0400 |
commit | 4c99c13ad7645ced273376b6baaf703f98b004e0 (patch) | |
tree | bfb2f44f4df9c2d4cc6161554342821127c427e1 /drivers/rtc/rtc-s3c.c | |
parent | 288031bfef43b39b12dcaaad6b950d4742620243 (diff) |
rtc: rtc-s3c: 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>
Diffstat (limited to 'drivers/rtc/rtc-s3c.c')
-rw-r--r-- | drivers/rtc/rtc-s3c.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c index fb994e9ddc15..7dcf719d9b85 100644 --- a/drivers/rtc/rtc-s3c.c +++ b/drivers/rtc/rtc-s3c.c | |||
@@ -423,10 +423,7 @@ static void s3c_rtc_enable(struct platform_device *pdev, int en) | |||
423 | 423 | ||
424 | static int s3c_rtc_remove(struct platform_device *dev) | 424 | static int s3c_rtc_remove(struct platform_device *dev) |
425 | { | 425 | { |
426 | struct rtc_device *rtc = platform_get_drvdata(dev); | ||
427 | |||
428 | platform_set_drvdata(dev, NULL); | 426 | platform_set_drvdata(dev, NULL); |
429 | rtc_device_unregister(rtc); | ||
430 | 427 | ||
431 | s3c_rtc_setaie(&dev->dev, 0); | 428 | s3c_rtc_setaie(&dev->dev, 0); |
432 | 429 | ||
@@ -511,7 +508,7 @@ static int s3c_rtc_probe(struct platform_device *pdev) | |||
511 | 508 | ||
512 | /* register RTC and exit */ | 509 | /* register RTC and exit */ |
513 | 510 | ||
514 | rtc = rtc_device_register("s3c", &pdev->dev, &s3c_rtcops, | 511 | rtc = devm_rtc_device_register(&pdev->dev, "s3c", &s3c_rtcops, |
515 | THIS_MODULE); | 512 | THIS_MODULE); |
516 | 513 | ||
517 | if (IS_ERR(rtc)) { | 514 | if (IS_ERR(rtc)) { |
@@ -574,7 +571,6 @@ static int s3c_rtc_probe(struct platform_device *pdev) | |||
574 | 571 | ||
575 | err_alarm_irq: | 572 | err_alarm_irq: |
576 | platform_set_drvdata(pdev, NULL); | 573 | platform_set_drvdata(pdev, NULL); |
577 | rtc_device_unregister(rtc); | ||
578 | 574 | ||
579 | err_nortc: | 575 | err_nortc: |
580 | s3c_rtc_enable(pdev, 0); | 576 | s3c_rtc_enable(pdev, 0); |