]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/rtc/rtc-m41t80.c
Merge branch 'stable/fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad...
[mv-sheeva.git] / drivers / rtc / rtc-m41t80.c
index 038095d99976e294629873443866b63e7eb7d19e..66377f3e28b851eaa908c6057a9646a639e9c229 100644 (file)
@@ -121,7 +121,7 @@ static int m41t80_get_datetime(struct i2c_client *client,
 
        /* assume 20YY not 19YY, and ignore the Century Bit */
        tm->tm_year = bcd2bin(buf[M41T80_REG_YEAR]) + 100;
-       return 0;
+       return rtc_valid_tm(tm);
 }
 
 /* Sets the given date and time to the real time clock. */
@@ -364,7 +364,7 @@ static int m41t80_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *t)
        t->time.tm_isdst = -1;
        t->enabled = !!(reg[M41T80_REG_ALARM_MON] & M41T80_ALMON_AFE);
        t->pending = !!(reg[M41T80_REG_FLAGS] & M41T80_FLAGS_AF);
-       return 0;
+       return rtc_valid_tm(t);
 }
 
 static struct rtc_class_ops m41t80_rtc_ops = {
@@ -595,10 +595,6 @@ static void wdt_disable(void)
 static ssize_t wdt_write(struct file *file, const char __user *buf,
                         size_t count, loff_t *ppos)
 {
-       /*  Can't seek (pwrite) on this device
-       if (ppos != &file->f_pos)
-       return -ESPIPE;
-       */
        if (count) {
                wdt_ping();
                return 1;
@@ -707,7 +703,7 @@ static int wdt_open(struct inode *inode, struct file *file)
                 */
                wdt_is_open = 1;
                unlock_kernel();
-               return 0;
+               return nonseekable_open(inode, file);
        }
        return -ENODEV;
 }