Using devm_rtc_device_register() helper to simplify code.
Cc: Hans Ulli Kroll <[email protected]>
Cc: Alessandro Zummo <[email protected]>
Cc: Alexandre Belloni <[email protected]>
Signed-off-by: Kefeng Wang <[email protected]>
---
drivers/rtc/rtc-gemini.c | 14 ++------------
1 file changed, 2 insertions(+), 12 deletions(-)
diff --git a/drivers/rtc/rtc-gemini.c b/drivers/rtc/rtc-gemini.c
index 688debc..504b6c1 100644
--- a/drivers/rtc/rtc-gemini.c
+++ b/drivers/rtc/rtc-gemini.c
@@ -145,26 +145,16 @@ static int gemini_rtc_probe(struct platform_device *pdev)
if (unlikely(ret))
return ret;
- rtc->rtc_dev = rtc_device_register(pdev->name, dev,
- &gemini_rtc_ops, THIS_MODULE);
+ rtc->rtc_dev = devm_rtc_device_register(dev, pdev->name,
&gemini_rtc_ops,
+ THIS_MODULE);
return PTR_ERR_OR_ZERO(rtc->rtc_dev);
}
-static int gemini_rtc_remove(struct platform_device *pdev)
-{
- struct gemini_rtc *rtc = platform_get_drvdata(pdev);
-
- rtc_device_unregister(rtc->rtc_dev);
-
- return 0;
-}
-
static struct platform_driver gemini_rtc_driver = {
.driver = {
.name = DRV_NAME,
},
.probe = gemini_rtc_probe,
- .remove = gemini_rtc_remove,
};
module_platform_driver_probe(gemini_rtc_driver, gemini_rtc_probe);
--
1.7.12.4
--
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
---
You received this message because you are subscribed to the Google Groups
"rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.