diff options
Diffstat (limited to 'drivers/rtc/rtc-ds1553.c')
-rw-r--r-- | drivers/rtc/rtc-ds1553.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/rtc/rtc-ds1553.c b/drivers/rtc/rtc-ds1553.c index 2090014..9647188 100644 --- a/drivers/rtc/rtc-ds1553.c +++ b/drivers/rtc/rtc-ds1553.c @@ -18,7 +18,7 @@ #include <linux/platform_device.h> #include <linux/io.h> -#define DRV_VERSION "0.1" +#define DRV_VERSION "0.2" #define RTC_REG_SIZE 0x2000 #define RTC_OFFSET 0x1ff0 @@ -250,7 +250,7 @@ static int ds1553_rtc_ioctl(struct device *dev, unsigned int cmd, return 0; } -static struct rtc_class_ops ds1553_rtc_ops = { +static const struct rtc_class_ops ds1553_rtc_ops = { .read_time = ds1553_rtc_read_time, .set_time = ds1553_rtc_set_time, .read_alarm = ds1553_rtc_read_alarm, @@ -357,9 +357,13 @@ static int __init ds1553_rtc_probe(struct platform_device *pdev) pdata->rtc = rtc; pdata->last_jiffies = jiffies; platform_set_drvdata(pdev, pdata); - sysfs_create_bin_file(&pdev->dev.kobj, &ds1553_nvram_attr); + ret = sysfs_create_bin_file(&pdev->dev.kobj, &ds1553_nvram_attr); + if (ret) + goto out; return 0; out: + if (pdata->rtc) + rtc_device_unregister(pdata->rtc); if (pdata->irq >= 0) free_irq(pdata->irq, pdev); if (ioaddr) |