hc
2024-01-04 1543e317f1da31b75942316931e8f491a8920811
kernel/drivers/rtc/rtc-em3027.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * An rtc/i2c driver for the EM Microelectronic EM3027
34 * Copyright 2011 CompuLab, Ltd.
....@@ -5,10 +6,6 @@
56 * Author: Mike Rapoport <mike@compulab.co.il>
67 *
78 * Based on rtc-ds1672.c by Alessandro Zummo <a.zummo@towertech.it>
8
- *
9
- * This program is free software; you can redistribute it and/or modify
10
- * it under the terms of the GNU General Public License version 2 as
11
- * published by the Free Software Foundation.
129 */
1310
1411 #include <linux/i2c.h>
....@@ -74,7 +71,7 @@
7471 tm->tm_hour = bcd2bin(buf[2]);
7572 tm->tm_mday = bcd2bin(buf[3]);
7673 tm->tm_wday = bcd2bin(buf[4]);
77
- tm->tm_mon = bcd2bin(buf[5]);
74
+ tm->tm_mon = bcd2bin(buf[5]) - 1;
7875 tm->tm_year = bcd2bin(buf[6]) + 100;
7976
8077 return 0;
....@@ -97,7 +94,7 @@
9794 buf[3] = bin2bcd(tm->tm_hour);
9895 buf[4] = bin2bcd(tm->tm_mday);
9996 buf[5] = bin2bcd(tm->tm_wday);
100
- buf[6] = bin2bcd(tm->tm_mon);
97
+ buf[6] = bin2bcd(tm->tm_mon + 1);
10198 buf[7] = bin2bcd(tm->tm_year % 100);
10299
103100 /* write time/date registers */