diff options
author | Jingoo Han <jg1.han@samsung.com> | 2013-04-29 19:19:15 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-04-29 21:28:27 -0400 |
commit | 77cf81b39f4d085077b5f11e9bb485a79b95a6a5 (patch) | |
tree | d5f4a849e0464036509308ddddae432e5f6d5bd2 /drivers/rtc/rtc-tps6586x.c | |
parent | 9c6813d7e680f938c3c2d6d87540106992f97366 (diff) |
rtc: rtc-tps6586x: 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-tps6586x.c')
-rw-r--r-- | drivers/rtc/rtc-tps6586x.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/rtc/rtc-tps6586x.c b/drivers/rtc/rtc-tps6586x.c index aab4e8c93622..b6aab9f80f73 100644 --- a/drivers/rtc/rtc-tps6586x.c +++ b/drivers/rtc/rtc-tps6586x.c | |||
@@ -274,7 +274,7 @@ static int tps6586x_rtc_probe(struct platform_device *pdev) | |||
274 | } | 274 | } |
275 | 275 | ||
276 | platform_set_drvdata(pdev, rtc); | 276 | platform_set_drvdata(pdev, rtc); |
277 | rtc->rtc = rtc_device_register(dev_name(&pdev->dev), &pdev->dev, | 277 | rtc->rtc = devm_rtc_device_register(&pdev->dev, dev_name(&pdev->dev), |
278 | &tps6586x_rtc_ops, THIS_MODULE); | 278 | &tps6586x_rtc_ops, THIS_MODULE); |
279 | if (IS_ERR(rtc->rtc)) { | 279 | if (IS_ERR(rtc->rtc)) { |
280 | ret = PTR_ERR(rtc->rtc); | 280 | ret = PTR_ERR(rtc->rtc); |
@@ -306,12 +306,10 @@ fail_rtc_register: | |||
306 | 306 | ||
307 | static int tps6586x_rtc_remove(struct platform_device *pdev) | 307 | static int tps6586x_rtc_remove(struct platform_device *pdev) |
308 | { | 308 | { |
309 | struct tps6586x_rtc *rtc = platform_get_drvdata(pdev); | ||
310 | struct device *tps_dev = to_tps6586x_dev(&pdev->dev); | 309 | struct device *tps_dev = to_tps6586x_dev(&pdev->dev); |
311 | 310 | ||
312 | tps6586x_update(tps_dev, RTC_CTRL, 0, | 311 | tps6586x_update(tps_dev, RTC_CTRL, 0, |
313 | RTC_ENABLE | OSC_SRC_SEL | PRE_BYPASS | CL_SEL_MASK); | 312 | RTC_ENABLE | OSC_SRC_SEL | PRE_BYPASS | CL_SEL_MASK); |
314 | rtc_device_unregister(rtc->rtc); | ||
315 | return 0; | 313 | return 0; |
316 | } | 314 | } |
317 | 315 | ||