aboutsummaryrefslogtreecommitdiff
path: root/drivers/rtc/rtc-ep93xx.c
diff options
context:
space:
mode:
authorJingoo Han <jg1.han@samsung.com>2013-04-29 16:19:02 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2013-04-29 18:28:25 -0700
commit5d65cbfbc81d66b71f853488f53373352f06e44e (patch)
treed2b4ebe6f50e6bb27d0f7d13a687313d72357a9a /drivers/rtc/rtc-ep93xx.c
parentf7cfdea08a148f89b4139f3e74be0b7fbc271c13 (diff)
downloadvexpress-lsk-5d65cbfbc81d66b71f853488f53373352f06e44e.tar.gz
rtc: rtc-ep93xx: 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-ep93xx.c')
-rw-r--r--drivers/rtc/rtc-ep93xx.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/rtc/rtc-ep93xx.c b/drivers/rtc/rtc-ep93xx.c
index 1a4e5e4a70c..5807b77c444 100644
--- a/drivers/rtc/rtc-ep93xx.c
+++ b/drivers/rtc/rtc-ep93xx.c
@@ -153,8 +153,8 @@ static int ep93xx_rtc_probe(struct platform_device *pdev)
pdev->dev.platform_data = ep93xx_rtc;
platform_set_drvdata(pdev, ep93xx_rtc);
- ep93xx_rtc->rtc = rtc_device_register(pdev->name,
- &pdev->dev, &ep93xx_rtc_ops, THIS_MODULE);
+ ep93xx_rtc->rtc = devm_rtc_device_register(&pdev->dev,
+ pdev->name, &ep93xx_rtc_ops, THIS_MODULE);
if (IS_ERR(ep93xx_rtc->rtc)) {
err = PTR_ERR(ep93xx_rtc->rtc);
goto exit;
@@ -162,12 +162,10 @@ static int ep93xx_rtc_probe(struct platform_device *pdev)
err = sysfs_create_group(&pdev->dev.kobj, &ep93xx_rtc_sysfs_files);
if (err)
- goto fail;
+ goto exit;
return 0;
-fail:
- rtc_device_unregister(ep93xx_rtc->rtc);
exit:
platform_set_drvdata(pdev, NULL);
pdev->dev.platform_data = NULL;
@@ -176,11 +174,8 @@ exit:
static int ep93xx_rtc_remove(struct platform_device *pdev)
{
- struct ep93xx_rtc *ep93xx_rtc = platform_get_drvdata(pdev);
-
sysfs_remove_group(&pdev->dev.kobj, &ep93xx_rtc_sysfs_files);
platform_set_drvdata(pdev, NULL);
- rtc_device_unregister(ep93xx_rtc->rtc);
pdev->dev.platform_data = NULL;
return 0;