Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 37669
b: refs/heads/master
c: 391b1fe
h: refs/heads/master
i:
  37667: ac8ce8c
v: v3
  • Loading branch information
Atsushi Nemoto authored and Linus Torvalds committed Oct 1, 2006
1 parent 39177d4 commit 64d97fe
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 90b4d648f02a653b192be7f0feb0a933b7525e6a
refs/heads/master: 391b1fe67d193df75144a92b146613c36491ef0d
8 changes: 6 additions & 2 deletions trunk/drivers/rtc/rtc-ds1553.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
10 changes: 7 additions & 3 deletions trunk/drivers/rtc/rtc-ds1742.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include <linux/platform_device.h>
#include <linux/io.h>

#define DRV_VERSION "0.1"
#define DRV_VERSION "0.2"

#define RTC_REG_SIZE 0x800
#define RTC_OFFSET 0x7f8
Expand Down Expand Up @@ -196,7 +196,7 @@ static int __init ds1742_rtc_probe(struct platform_device *pdev)
writeb(sec, ioaddr + RTC_SECONDS);
writeb(cen & RTC_CENTURY_MASK, ioaddr + RTC_CONTROL);
}
if (readb(ioaddr + RTC_DAY) & RTC_BATT_FLAG)
if (!(readb(ioaddr + RTC_DAY) & RTC_BATT_FLAG))
dev_warn(&pdev->dev, "voltage-low detected.\n");

rtc = rtc_device_register(pdev->name, &pdev->dev,
Expand All @@ -208,9 +208,13 @@ static int __init ds1742_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, &ds1742_nvram_attr);
ret = sysfs_create_bin_file(&pdev->dev.kobj, &ds1742_nvram_attr);
if (ret)
goto out;
return 0;
out:
if (pdata->rtc)
rtc_device_unregister(pdata->rtc);
if (ioaddr)
iounmap(ioaddr);
if (pdata->baseaddr)
Expand Down

0 comments on commit 64d97fe

Please sign in to comment.