diff options
author | Jingoo Han <jg1.han@samsung.com> | 2013-04-29 19:18:58 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-04-29 21:28:25 -0400 |
commit | 8ae236b8c97fc65fd586fa6993184d2890b7016b (patch) | |
tree | 114717aa08d999723498135f8797a4fcbc55809f /drivers/rtc/rtc-davinci.c | |
parent | 8c32edb57fc68497c719971cc25944af424aaf3a (diff) |
rtc: rtc-davinci: 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-davinci.c')
-rw-r--r-- | drivers/rtc/rtc-davinci.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/rtc/rtc-davinci.c b/drivers/rtc/rtc-davinci.c index 1b0f932266eb..a55048c3e26f 100644 --- a/drivers/rtc/rtc-davinci.c +++ b/drivers/rtc/rtc-davinci.c | |||
@@ -523,7 +523,7 @@ static int __init davinci_rtc_probe(struct platform_device *pdev) | |||
523 | 523 | ||
524 | platform_set_drvdata(pdev, davinci_rtc); | 524 | platform_set_drvdata(pdev, davinci_rtc); |
525 | 525 | ||
526 | davinci_rtc->rtc = rtc_device_register(pdev->name, &pdev->dev, | 526 | davinci_rtc->rtc = devm_rtc_device_register(&pdev->dev, pdev->name, |
527 | &davinci_rtc_ops, THIS_MODULE); | 527 | &davinci_rtc_ops, THIS_MODULE); |
528 | if (IS_ERR(davinci_rtc->rtc)) { | 528 | if (IS_ERR(davinci_rtc->rtc)) { |
529 | ret = PTR_ERR(davinci_rtc->rtc); | 529 | ret = PTR_ERR(davinci_rtc->rtc); |
@@ -543,7 +543,7 @@ static int __init davinci_rtc_probe(struct platform_device *pdev) | |||
543 | 0, "davinci_rtc", davinci_rtc); | 543 | 0, "davinci_rtc", davinci_rtc); |
544 | if (ret < 0) { | 544 | if (ret < 0) { |
545 | dev_err(dev, "unable to register davinci RTC interrupt\n"); | 545 | dev_err(dev, "unable to register davinci RTC interrupt\n"); |
546 | goto fail2; | 546 | goto fail1; |
547 | } | 547 | } |
548 | 548 | ||
549 | /* Enable interrupts */ | 549 | /* Enable interrupts */ |
@@ -557,8 +557,6 @@ static int __init davinci_rtc_probe(struct platform_device *pdev) | |||
557 | 557 | ||
558 | return 0; | 558 | return 0; |
559 | 559 | ||
560 | fail2: | ||
561 | rtc_device_unregister(davinci_rtc->rtc); | ||
562 | fail1: | 560 | fail1: |
563 | platform_set_drvdata(pdev, NULL); | 561 | platform_set_drvdata(pdev, NULL); |
564 | return ret; | 562 | return ret; |
@@ -572,8 +570,6 @@ static int __exit davinci_rtc_remove(struct platform_device *pdev) | |||
572 | 570 | ||
573 | rtcif_write(davinci_rtc, 0, PRTCIF_INTEN); | 571 | rtcif_write(davinci_rtc, 0, PRTCIF_INTEN); |
574 | 572 | ||
575 | rtc_device_unregister(davinci_rtc->rtc); | ||
576 | |||
577 | platform_set_drvdata(pdev, NULL); | 573 | platform_set_drvdata(pdev, NULL); |
578 | 574 | ||
579 | return 0; | 575 | return 0; |