diff options
Diffstat (limited to 'drivers/rtc/rtc-mv.c')
-rw-r--r-- | drivers/rtc/rtc-mv.c | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/drivers/rtc/rtc-mv.c b/drivers/rtc/rtc-mv.c index 8f87fec27ce7..baab802f2153 100644 --- a/drivers/rtc/rtc-mv.c +++ b/drivers/rtc/rtc-mv.c | |||
@@ -217,7 +217,7 @@ static const struct rtc_class_ops mv_rtc_alarm_ops = { | |||
217 | .alarm_irq_enable = mv_rtc_alarm_irq_enable, | 217 | .alarm_irq_enable = mv_rtc_alarm_irq_enable, |
218 | }; | 218 | }; |
219 | 219 | ||
220 | static int mv_rtc_probe(struct platform_device *pdev) | 220 | static int __init mv_rtc_probe(struct platform_device *pdev) |
221 | { | 221 | { |
222 | struct resource *res; | 222 | struct resource *res; |
223 | struct rtc_plat_data *pdata; | 223 | struct rtc_plat_data *pdata; |
@@ -272,12 +272,13 @@ static int mv_rtc_probe(struct platform_device *pdev) | |||
272 | 272 | ||
273 | if (pdata->irq >= 0) { | 273 | if (pdata->irq >= 0) { |
274 | device_init_wakeup(&pdev->dev, 1); | 274 | device_init_wakeup(&pdev->dev, 1); |
275 | pdata->rtc = rtc_device_register(pdev->name, &pdev->dev, | 275 | pdata->rtc = devm_rtc_device_register(&pdev->dev, pdev->name, |
276 | &mv_rtc_alarm_ops, | 276 | &mv_rtc_alarm_ops, |
277 | THIS_MODULE); | 277 | THIS_MODULE); |
278 | } else | 278 | } else { |
279 | pdata->rtc = rtc_device_register(pdev->name, &pdev->dev, | 279 | pdata->rtc = devm_rtc_device_register(&pdev->dev, pdev->name, |
280 | &mv_rtc_ops, THIS_MODULE); | 280 | &mv_rtc_ops, THIS_MODULE); |
281 | } | ||
281 | if (IS_ERR(pdata->rtc)) { | 282 | if (IS_ERR(pdata->rtc)) { |
282 | ret = PTR_ERR(pdata->rtc); | 283 | ret = PTR_ERR(pdata->rtc); |
283 | goto out; | 284 | goto out; |
@@ -308,7 +309,6 @@ static int __exit mv_rtc_remove(struct platform_device *pdev) | |||
308 | if (pdata->irq >= 0) | 309 | if (pdata->irq >= 0) |
309 | device_init_wakeup(&pdev->dev, 0); | 310 | device_init_wakeup(&pdev->dev, 0); |
310 | 311 | ||
311 | rtc_device_unregister(pdata->rtc); | ||
312 | if (!IS_ERR(pdata->clk)) | 312 | if (!IS_ERR(pdata->clk)) |
313 | clk_disable_unprepare(pdata->clk); | 313 | clk_disable_unprepare(pdata->clk); |
314 | 314 | ||
@@ -331,18 +331,7 @@ static struct platform_driver mv_rtc_driver = { | |||
331 | }, | 331 | }, |
332 | }; | 332 | }; |
333 | 333 | ||
334 | static __init int mv_init(void) | 334 | module_platform_driver_probe(mv_rtc_driver, mv_rtc_probe); |
335 | { | ||
336 | return platform_driver_probe(&mv_rtc_driver, mv_rtc_probe); | ||
337 | } | ||
338 | |||
339 | static __exit void mv_exit(void) | ||
340 | { | ||
341 | platform_driver_unregister(&mv_rtc_driver); | ||
342 | } | ||
343 | |||
344 | module_init(mv_init); | ||
345 | module_exit(mv_exit); | ||
346 | 335 | ||
347 | MODULE_AUTHOR("Saeed Bishara <saeed@marvell.com>"); | 336 | MODULE_AUTHOR("Saeed Bishara <saeed@marvell.com>"); |
348 | MODULE_DESCRIPTION("Marvell RTC driver"); | 337 | MODULE_DESCRIPTION("Marvell RTC driver"); |