nfsd: move most of nfsfh.h to fs/nfsd
[safe/jmp/linux-2.6] / drivers / rtc / rtc-ds1511.c
index 7bb0a96..0b6b773 100644 (file)
@@ -326,9 +326,9 @@ ds1511_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
        struct platform_device *pdev = to_platform_device(dev);
        struct rtc_plat_data *pdata = platform_get_drvdata(pdev);
 
-       if (pdata->irq < 0) {
+       if (pdata->irq <= 0)
                return -EINVAL;
-       }
+
        pdata->alrm_mday = alrm->time.tm_mday;
        pdata->alrm_hour = alrm->time.tm_hour;
        pdata->alrm_min = alrm->time.tm_min;
@@ -346,9 +346,9 @@ ds1511_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)
        struct platform_device *pdev = to_platform_device(dev);
        struct rtc_plat_data *pdata = platform_get_drvdata(pdev);
 
-       if (pdata->irq < 0) {
+       if (pdata->irq <= 0)
                return -EINVAL;
-       }
+
        alrm->time.tm_mday = pdata->alrm_mday < 0 ? 0 : pdata->alrm_mday;
        alrm->time.tm_hour = pdata->alrm_hour < 0 ? 0 : pdata->alrm_hour;
        alrm->time.tm_min = pdata->alrm_min < 0 ? 0 : pdata->alrm_min;
@@ -385,7 +385,7 @@ ds1511_rtc_ioctl(struct device *dev, unsigned int cmd, unsigned long arg)
        struct platform_device *pdev = to_platform_device(dev);
        struct rtc_plat_data *pdata = platform_get_drvdata(pdev);
 
-       if (pdata->irq < 0) {
+       if (pdata->irq <= 0) {
                return -ENOIOCTLCMD; /* fall back into rtc-dev's emulation */
        }
        switch (cmd) {
@@ -481,7 +481,6 @@ static struct bin_attribute ds1511_nvram_attr = {
        .attr = {
                .name = "nvram",
                .mode = S_IRUGO | S_IWUGO,
-               .owner = THIS_MODULE,
        },
        .size = DS1511_RAM_MAX,
        .read = ds1511_nvram_read,
@@ -504,7 +503,6 @@ ds1511_rtc_probe(struct platform_device *pdev)
        if (!pdata) {
                return -ENOMEM;
        }
-       pdata->irq = -1;
        pdata->size = res->end - res->start + 1;
        if (!request_mem_region(res->start, pdata->size, pdev->name)) {
                ret = -EBUSY;
@@ -546,13 +544,13 @@ ds1511_rtc_probe(struct platform_device *pdev)
         * if the platform has an interrupt in mind for this device,
         * then by all means, set it
         */
-       if (pdata->irq >= 0) {
+       if (pdata->irq > 0) {
                rtc_read(RTC_CMD1);
                if (request_irq(pdata->irq, ds1511_interrupt,
                        IRQF_DISABLED | IRQF_SHARED, pdev->name, pdev) < 0) {
 
                        dev_warn(&pdev->dev, "interrupt not available.\n");
-                       pdata->irq = -1;
+                       pdata->irq = 0;
                }
        }
 
@@ -573,7 +571,7 @@ ds1511_rtc_probe(struct platform_device *pdev)
        if (pdata->rtc) {
                rtc_device_unregister(pdata->rtc);
        }
-       if (pdata->irq >= 0) {
+       if (pdata->irq > 0) {
                free_irq(pdata->irq, pdev);
        }
        if (ds1511_base) {
@@ -596,7 +594,7 @@ ds1511_rtc_remove(struct platform_device *pdev)
        sysfs_remove_bin_file(&pdev->dev.kobj, &ds1511_nvram_attr);
        rtc_device_unregister(pdata->rtc);
        pdata->rtc = NULL;
-       if (pdata->irq >= 0) {
+       if (pdata->irq > 0) {
                /*
                 * disable the alarm interrupt
                 */
@@ -632,7 +630,7 @@ ds1511_rtc_init(void)
  static void __exit
 ds1511_rtc_exit(void)
 {
-       return platform_driver_unregister(&ds1511_rtc_driver);
+       platform_driver_unregister(&ds1511_rtc_driver);
 }
 
 module_init(ds1511_rtc_init);