[SCSI] qla2xxx: Update firmware link in Kconfig file.
[firefly-linux-kernel-4.4.55.git] / drivers / rtc / rtc-ds1302.c
index fdbcdb289d605d21e26f7bb0006db8bd7709bbf4..d139543462863dc1f598b5486ac4760bd72c0b6d 100644 (file)
@@ -224,7 +224,7 @@ static int __init ds1302_rtc_probe(struct platform_device *pdev)
                return -ENODEV;
        }
 
-       rtc = rtc_device_register("ds1302", &pdev->dev,
+       rtc = devm_rtc_device_register(&pdev->dev, "ds1302",
                                           &ds1302_rtc_ops, THIS_MODULE);
        if (IS_ERR(rtc))
                return PTR_ERR(rtc);
@@ -234,11 +234,8 @@ static int __init ds1302_rtc_probe(struct platform_device *pdev)
        return 0;
 }
 
-static int ds1302_rtc_remove(struct platform_device *pdev)
+static int __exit ds1302_rtc_remove(struct platform_device *pdev)
 {
-       struct rtc_device *rtc = platform_get_drvdata(pdev);
-
-       rtc_device_unregister(rtc);
        platform_set_drvdata(pdev, NULL);
 
        return 0;
@@ -249,21 +246,10 @@ static struct platform_driver ds1302_platform_driver = {
                .name   = DRV_NAME,
                .owner  = THIS_MODULE,
        },
-       .remove         = ds1302_rtc_remove,
+       .remove         = __exit_p(ds1302_rtc_remove),
 };
 
-static int __init ds1302_rtc_init(void)
-{
-       return platform_driver_probe(&ds1302_platform_driver, ds1302_rtc_probe);
-}
-
-static void __exit ds1302_rtc_exit(void)
-{
-       platform_driver_unregister(&ds1302_platform_driver);
-}
-
-module_init(ds1302_rtc_init);
-module_exit(ds1302_rtc_exit);
+module_platform_driver_probe(ds1302_platform_driver, ds1302_rtc_probe);
 
 MODULE_DESCRIPTION("Dallas DS1302 RTC driver");
 MODULE_VERSION(DRV_VERSION);