diff options
Diffstat (limited to 'drivers/rtc/rtc-ab3100.c')
-rw-r--r-- | drivers/rtc/rtc-ab3100.c | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/drivers/rtc/rtc-ab3100.c b/drivers/rtc/rtc-ab3100.c index 261a07e0fb24..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 | } |
@@ -257,19 +254,7 @@ static struct platform_driver ab3100_rtc_driver = { | |||
257 | .remove = __exit_p(ab3100_rtc_remove), | 254 | .remove = __exit_p(ab3100_rtc_remove), |
258 | }; | 255 | }; |
259 | 256 | ||
260 | static int __init ab3100_rtc_init(void) | 257 | module_platform_driver_probe(ab3100_rtc_driver, ab3100_rtc_probe); |
261 | { | ||
262 | return platform_driver_probe(&ab3100_rtc_driver, | ||
263 | ab3100_rtc_probe); | ||
264 | } | ||
265 | |||
266 | static void __exit ab3100_rtc_exit(void) | ||
267 | { | ||
268 | platform_driver_unregister(&ab3100_rtc_driver); | ||
269 | } | ||
270 | |||
271 | module_init(ab3100_rtc_init); | ||
272 | module_exit(ab3100_rtc_exit); | ||
273 | 258 | ||
274 | MODULE_AUTHOR("Linus Walleij <linus.walleij@stericsson.com>"); | 259 | MODULE_AUTHOR("Linus Walleij <linus.walleij@stericsson.com>"); |
275 | MODULE_DESCRIPTION("AB3100 RTC Driver"); | 260 | MODULE_DESCRIPTION("AB3100 RTC Driver"); |