diff options
author | Jingoo Han <jg1.han@samsung.com> | 2013-04-29 19:19:30 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-04-29 21:28:29 -0400 |
commit | ef886c4d75f0872424f61815662dd37e84b2d34e (patch) | |
tree | 156259f4b5ca7a6f857bda87f4bf29d5ab247cec /drivers/rtc/rtc-ab3100.c | |
parent | 198b8ec844ddbf254d9221815c74bb3465b215bc (diff) |
rtc: rtc-ab3100: 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-ab3100.c')
-rw-r--r-- | drivers/rtc/rtc-ab3100.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/rtc/rtc-ab3100.c b/drivers/rtc/rtc-ab3100.c index c2f12d370009..47a4f2c4d30e 100644 --- a/drivers/rtc/rtc-ab3100.c +++ b/drivers/rtc/rtc-ab3100.c | |||
@@ -229,8 +229,8 @@ static int __init ab3100_rtc_probe(struct platform_device *pdev) | |||
229 | /* Ignore any error on this write */ | 229 | /* Ignore any error on this write */ |
230 | } | 230 | } |
231 | 231 | ||
232 | rtc = rtc_device_register("ab3100-rtc", &pdev->dev, &ab3100_rtc_ops, | 232 | rtc = devm_rtc_device_register(&pdev->dev, "ab3100-rtc", |
233 | THIS_MODULE); | 233 | &ab3100_rtc_ops, THIS_MODULE); |
234 | if (IS_ERR(rtc)) { | 234 | if (IS_ERR(rtc)) { |
235 | err = PTR_ERR(rtc); | 235 | err = PTR_ERR(rtc); |
236 | return err; | 236 | return err; |
@@ -242,9 +242,6 @@ static int __init ab3100_rtc_probe(struct platform_device *pdev) | |||
242 | 242 | ||
243 | static int __exit ab3100_rtc_remove(struct platform_device *pdev) | 243 | static int __exit ab3100_rtc_remove(struct platform_device *pdev) |
244 | { | 244 | { |
245 | struct rtc_device *rtc = platform_get_drvdata(pdev); | ||
246 | |||
247 | rtc_device_unregister(rtc); | ||
248 | platform_set_drvdata(pdev, NULL); | 245 | platform_set_drvdata(pdev, NULL); |
249 | return 0; | 246 | return 0; |
250 | } | 247 | } |