rtc: Add max77660 rtc driver
[linux-3.10.git] / drivers / rtc / rtc-ds1553.c
index 6f0a1b5..8c6c952 100644 (file)
@@ -276,7 +276,7 @@ static struct bin_attribute ds1553_nvram_attr = {
        .write = ds1553_nvram_write,
 };
 
-static int __devinit ds1553_rtc_probe(struct platform_device *pdev)
+static int ds1553_rtc_probe(struct platform_device *pdev)
 {
        struct rtc_device *rtc;
        struct resource *res;
@@ -320,30 +320,28 @@ static int __devinit ds1553_rtc_probe(struct platform_device *pdev)
                writeb(0, ioaddr + RTC_INTERRUPTS);
                if (devm_request_irq(&pdev->dev, pdata->irq,
                                ds1553_rtc_interrupt,
-                               IRQF_DISABLED, pdev->name, pdev) < 0) {
+                               0, pdev->name, pdev) < 0) {
                        dev_warn(&pdev->dev, "interrupt not available.\n");
                        pdata->irq = 0;
                }
        }
 
-       rtc = rtc_device_register(pdev->name, &pdev->dev,
+       rtc = devm_rtc_device_register(&pdev->dev, pdev->name,
                                  &ds1553_rtc_ops, THIS_MODULE);
        if (IS_ERR(rtc))
                return PTR_ERR(rtc);
        pdata->rtc = rtc;
 
        ret = sysfs_create_bin_file(&pdev->dev.kobj, &ds1553_nvram_attr);
-       if (ret)
-               rtc_device_unregister(rtc);
+
        return ret;
 }
 
-static int __devexit ds1553_rtc_remove(struct platform_device *pdev)
+static int ds1553_rtc_remove(struct platform_device *pdev)
 {
        struct rtc_plat_data *pdata = platform_get_drvdata(pdev);
 
        sysfs_remove_bin_file(&pdev->dev.kobj, &ds1553_nvram_attr);
-       rtc_device_unregister(pdata->rtc);
        if (pdata->irq > 0)
                writeb(0, pdata->ioaddr + RTC_INTERRUPTS);
        return 0;
@@ -354,7 +352,7 @@ MODULE_ALIAS("platform:rtc-ds1553");
 
 static struct platform_driver ds1553_rtc_driver = {
        .probe          = ds1553_rtc_probe,
-       .remove         = __devexit_p(ds1553_rtc_remove),
+       .remove         = ds1553_rtc_remove,
        .driver         = {
                .name   = "rtc-ds1553",
                .owner  = THIS_MODULE,