aboutsummaryrefslogtreecommitdiffstats
path: root/arch/cris/arch-v32/drivers/pcf8563.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/cris/arch-v32/drivers/pcf8563.c')
-rw-r--r--arch/cris/arch-v32/drivers/pcf8563.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/arch/cris/arch-v32/drivers/pcf8563.c b/arch/cris/arch-v32/drivers/pcf8563.c
index f263ab571221..f4478506e52c 100644
--- a/arch/cris/arch-v32/drivers/pcf8563.c
+++ b/arch/cris/arch-v32/drivers/pcf8563.c
@@ -118,7 +118,7 @@ get_rtc_time(struct rtc_time *tm)
118 "information is no longer guaranteed!\n", PCF8563_NAME); 118 "information is no longer guaranteed!\n", PCF8563_NAME);
119 } 119 }
120 120
121 tm->tm_year = BCD_TO_BIN(tm->tm_year) + 121 tm->tm_year = bcd2bin(tm->tm_year) +
122 ((tm->tm_mon & 0x80) ? 100 : 0); 122 ((tm->tm_mon & 0x80) ? 100 : 0);
123 tm->tm_sec &= 0x7F; 123 tm->tm_sec &= 0x7F;
124 tm->tm_min &= 0x7F; 124 tm->tm_min &= 0x7F;
@@ -127,11 +127,11 @@ get_rtc_time(struct rtc_time *tm)
127 tm->tm_wday &= 0x07; /* Not coded in BCD. */ 127 tm->tm_wday &= 0x07; /* Not coded in BCD. */
128 tm->tm_mon &= 0x1F; 128 tm->tm_mon &= 0x1F;
129 129
130 BCD_TO_BIN(tm->tm_sec); 130 tm->tm_sec = bcd2bin(tm->tm_sec);
131 BCD_TO_BIN(tm->tm_min); 131 tm->tm_min = bcd2bin(tm->tm_min);
132 BCD_TO_BIN(tm->tm_hour); 132 tm->tm_hour = bcd2bin(tm->tm_hour);
133 BCD_TO_BIN(tm->tm_mday); 133 tm->tm_mday = bcd2bin(tm->tm_mday);
134 BCD_TO_BIN(tm->tm_mon); 134 tm->tm_mon = bcd2bin(tm->tm_mon);
135 tm->tm_mon--; /* Month is 1..12 in RTC but 0..11 in linux */ 135 tm->tm_mon--; /* Month is 1..12 in RTC but 0..11 in linux */
136} 136}
137 137
@@ -279,12 +279,12 @@ int pcf8563_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
279 century = (tm.tm_year >= 2000) ? 0x80 : 0; 279 century = (tm.tm_year >= 2000) ? 0x80 : 0;
280 tm.tm_year = tm.tm_year % 100; 280 tm.tm_year = tm.tm_year % 100;
281 281
282 BIN_TO_BCD(tm.tm_year); 282 tm.tm_year = bin2bcd(tm.tm_year);
283 BIN_TO_BCD(tm.tm_mon); 283 tm.tm_mon = bin2bcd(tm.tm_mon);
284 BIN_TO_BCD(tm.tm_mday); 284 tm.tm_mday = bin2bcd(tm.tm_mday);
285 BIN_TO_BCD(tm.tm_hour); 285 tm.tm_hour = bin2bcd(tm.tm_hour);
286 BIN_TO_BCD(tm.tm_min); 286 tm.tm_min = bin2bcd(tm.tm_min);
287 BIN_TO_BCD(tm.tm_sec); 287 tm.tm_sec = bin2bcd(tm.tm_sec);
288 tm.tm_mon |= century; 288 tm.tm_mon |= century;
289 289
290 mutex_lock(&rtc_lock); 290 mutex_lock(&rtc_lock);