|
@@ -155,6 +155,9 @@ static int ds13307_set_time(struct device *dev, struct rtc_time *time) {
|
|
|
buf[5] = bin2bcd(time->tm_mday);
|
|
|
if ((model_detected == DEVICE_DS1337) && (time->tm_year >= 100)) {
|
|
|
buf[6] = bin2bcd(time->tm_mon + 1) | COMMON_HIGH_BIT;
|
|
|
+ } else if ((model_detected == DEVICE_DS1307) && (time->tm_year < 100)) {
|
|
|
+ printk(KERN_ERR "%s: device does not support century information, dates before 2000 are not possible\n", M_NAME);
|
|
|
+ return -EINVAL;
|
|
|
} else {
|
|
|
buf[6] = bin2bcd(time->tm_mon + 1);
|
|
|
}
|