aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc
diff options
context:
space:
mode:
authorAlexandre Belloni <alexandre.belloni@free-electrons.com>2016-02-23 18:05:28 -0500
committerAlexandre Belloni <alexandre.belloni@free-electrons.com>2016-03-14 12:08:26 -0400
commitba270bbbf43474fe459e206b5283996fd1511647 (patch)
tree6f0ab30fed866ee6fad276e7e23cfbf9f23eac74 /drivers/rtc
parenta25f4a95ec3cded34c1250364eba704c5e4fdac4 (diff)
rtc: pcf85063: remove useless century handling
pcf85063_get_datetime() tries to handle a century bit but that bit is not documented and the final value is never used anywhere else in the kernel. Reviewed-by: Juergen Borleis <jbe@pengutronix.de> Tested-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Diffstat (limited to 'drivers/rtc')
-rw-r--r--drivers/rtc/rtc-pcf85063.c7
1 files changed, 0 insertions, 7 deletions
diff --git a/drivers/rtc/rtc-pcf85063.c b/drivers/rtc/rtc-pcf85063.c
index c5db231f14de..4e940cc3d782 100644
--- a/drivers/rtc/rtc-pcf85063.c
+++ b/drivers/rtc/rtc-pcf85063.c
@@ -31,13 +31,10 @@
31#define PCF85063_REG_MO 0x09 31#define PCF85063_REG_MO 0x09
32#define PCF85063_REG_YR 0x0A 32#define PCF85063_REG_YR 0x0A
33 33
34#define PCF85063_MO_C 0x80 /* century */
35
36static struct i2c_driver pcf85063_driver; 34static struct i2c_driver pcf85063_driver;
37 35
38struct pcf85063 { 36struct pcf85063 {
39 struct rtc_device *rtc; 37 struct rtc_device *rtc;
40 int c_polarity; /* 0: MO_C=1 means 19xx, otherwise MO_C=1 means 20xx */
41 int voltage_low; /* indicates if a low_voltage was detected */ 38 int voltage_low; /* indicates if a low_voltage was detected */
42}; 39};
43 40
@@ -72,7 +69,6 @@ static int pcf85063_stop_clock(struct i2c_client *client, u8 *ctrl1)
72static int pcf85063_get_datetime(struct i2c_client *client, struct rtc_time *tm) 69static int pcf85063_get_datetime(struct i2c_client *client, struct rtc_time *tm)
73{ 70{
74 int rc; 71 int rc;
75 struct pcf85063 *pcf85063 = i2c_get_clientdata(client);
76 u8 regs[7]; 72 u8 regs[7];
77 73
78 /* 74 /*
@@ -103,9 +99,6 @@ static int pcf85063_get_datetime(struct i2c_client *client, struct rtc_time *tm)
103 tm->tm_year = bcd2bin(regs[6]); 99 tm->tm_year = bcd2bin(regs[6]);
104 if (tm->tm_year < 70) 100 if (tm->tm_year < 70)
105 tm->tm_year += 100; /* assume we are in 1970...2069 */ 101 tm->tm_year += 100; /* assume we are in 1970...2069 */
106 /* detect the polarity heuristically. see note above. */
107 pcf85063->c_polarity = (regs[5] & PCF85063_MO_C) ?
108 (tm->tm_year >= 100) : (tm->tm_year < 100);
109 102
110 return rtc_valid_tm(tm); 103 return rtc_valid_tm(tm);
111} 104}