aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-starfire.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/rtc/rtc-starfire.c')
-rw-r--r--drivers/rtc/rtc-starfire.c23
1 files changed, 5 insertions, 18 deletions
diff --git a/drivers/rtc/rtc-starfire.c b/drivers/rtc/rtc-starfire.c
index 5be98bfd7ed3..987b5ec0ae56 100644
--- a/drivers/rtc/rtc-starfire.c
+++ b/drivers/rtc/rtc-starfire.c
@@ -39,8 +39,10 @@ static const struct rtc_class_ops starfire_rtc_ops = {
39 39
40static int __init starfire_rtc_probe(struct platform_device *pdev) 40static int __init starfire_rtc_probe(struct platform_device *pdev)
41{ 41{
42 struct rtc_device *rtc = rtc_device_register("starfire", &pdev->dev, 42 struct rtc_device *rtc;
43 &starfire_rtc_ops, THIS_MODULE); 43
44 rtc = devm_rtc_device_register(&pdev->dev, "starfire",
45 &starfire_rtc_ops, THIS_MODULE);
44 if (IS_ERR(rtc)) 46 if (IS_ERR(rtc))
45 return PTR_ERR(rtc); 47 return PTR_ERR(rtc);
46 48
@@ -51,10 +53,6 @@ static int __init starfire_rtc_probe(struct platform_device *pdev)
51 53
52static int __exit starfire_rtc_remove(struct platform_device *pdev) 54static int __exit starfire_rtc_remove(struct platform_device *pdev)
53{ 55{
54 struct rtc_device *rtc = platform_get_drvdata(pdev);
55
56 rtc_device_unregister(rtc);
57
58 return 0; 56 return 0;
59} 57}
60 58
@@ -66,15 +64,4 @@ static struct platform_driver starfire_rtc_driver = {
66 .remove = __exit_p(starfire_rtc_remove), 64 .remove = __exit_p(starfire_rtc_remove),
67}; 65};
68 66
69static int __init starfire_rtc_init(void) 67module_platform_driver_probe(starfire_rtc_driver, starfire_rtc_probe);
70{
71 return platform_driver_probe(&starfire_rtc_driver, starfire_rtc_probe);
72}
73
74static void __exit starfire_rtc_exit(void)
75{
76 platform_driver_unregister(&starfire_rtc_driver);
77}
78
79module_init(starfire_rtc_init);
80module_exit(starfire_rtc_exit);