aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-cmos.c
diff options
context:
space:
mode:
authorAdrian Bunk <bunk@kernel.org>2008-10-18 23:28:41 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-10-20 11:52:41 -0400
commitfe20ba70abf7d6e5855c3dacc729490b3d0d077f (patch)
tree918619427cc051d22cb38b44e94c7e65f29ee928 /drivers/rtc/rtc-cmos.c
parent4110a0d6206bd175419cc5503f80cc296d184cbf (diff)
drivers/rtc/: use bcd2bin/bin2bcd
Change drivers/rtc/ to use the new bcd2bin/bin2bcd functions instead of the obsolete BCD_TO_BIN/BIN_TO_BCD/BCD2BIN/BIN2BCD macros. Signed-off-by: Adrian Bunk <bunk@kernel.org> Acked-by: Alessandro Zummo <a.zummo@towertech.it> Cc: David Brownell <david-b@pacbell.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/rtc/rtc-cmos.c')
-rw-r--r--drivers/rtc/rtc-cmos.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/rtc/rtc-cmos.c b/drivers/rtc/rtc-cmos.c
index f1695d7fa0fa..957365e4a746 100644
--- a/drivers/rtc/rtc-cmos.c
+++ b/drivers/rtc/rtc-cmos.c
@@ -240,26 +240,26 @@ static int cmos_read_alarm(struct device *dev, struct rtc_wkalrm *t)
240 /* REVISIT this assumes PC style usage: always BCD */ 240 /* REVISIT this assumes PC style usage: always BCD */
241 241
242 if (((unsigned)t->time.tm_sec) < 0x60) 242 if (((unsigned)t->time.tm_sec) < 0x60)
243 t->time.tm_sec = BCD2BIN(t->time.tm_sec); 243 t->time.tm_sec = bcd2bin(t->time.tm_sec);
244 else 244 else
245 t->time.tm_sec = -1; 245 t->time.tm_sec = -1;
246 if (((unsigned)t->time.tm_min) < 0x60) 246 if (((unsigned)t->time.tm_min) < 0x60)
247 t->time.tm_min = BCD2BIN(t->time.tm_min); 247 t->time.tm_min = bcd2bin(t->time.tm_min);
248 else 248 else
249 t->time.tm_min = -1; 249 t->time.tm_min = -1;
250 if (((unsigned)t->time.tm_hour) < 0x24) 250 if (((unsigned)t->time.tm_hour) < 0x24)
251 t->time.tm_hour = BCD2BIN(t->time.tm_hour); 251 t->time.tm_hour = bcd2bin(t->time.tm_hour);
252 else 252 else
253 t->time.tm_hour = -1; 253 t->time.tm_hour = -1;
254 254
255 if (cmos->day_alrm) { 255 if (cmos->day_alrm) {
256 if (((unsigned)t->time.tm_mday) <= 0x31) 256 if (((unsigned)t->time.tm_mday) <= 0x31)
257 t->time.tm_mday = BCD2BIN(t->time.tm_mday); 257 t->time.tm_mday = bcd2bin(t->time.tm_mday);
258 else 258 else
259 t->time.tm_mday = -1; 259 t->time.tm_mday = -1;
260 if (cmos->mon_alrm) { 260 if (cmos->mon_alrm) {
261 if (((unsigned)t->time.tm_mon) <= 0x12) 261 if (((unsigned)t->time.tm_mon) <= 0x12)
262 t->time.tm_mon = BCD2BIN(t->time.tm_mon) - 1; 262 t->time.tm_mon = bcd2bin(t->time.tm_mon) - 1;
263 else 263 else
264 t->time.tm_mon = -1; 264 t->time.tm_mon = -1;
265 } 265 }
@@ -331,19 +331,19 @@ static int cmos_set_alarm(struct device *dev, struct rtc_wkalrm *t)
331 /* Writing 0xff means "don't care" or "match all". */ 331 /* Writing 0xff means "don't care" or "match all". */
332 332
333 mon = t->time.tm_mon + 1; 333 mon = t->time.tm_mon + 1;
334 mon = (mon <= 12) ? BIN2BCD(mon) : 0xff; 334 mon = (mon <= 12) ? bin2bcd(mon) : 0xff;
335 335
336 mday = t->time.tm_mday; 336 mday = t->time.tm_mday;
337 mday = (mday >= 1 && mday <= 31) ? BIN2BCD(mday) : 0xff; 337 mday = (mday >= 1 && mday <= 31) ? bin2bcd(mday) : 0xff;
338 338
339 hrs = t->time.tm_hour; 339 hrs = t->time.tm_hour;
340 hrs = (hrs < 24) ? BIN2BCD(hrs) : 0xff; 340 hrs = (hrs < 24) ? bin2bcd(hrs) : 0xff;
341 341
342 min = t->time.tm_min; 342 min = t->time.tm_min;
343 min = (min < 60) ? BIN2BCD(min) : 0xff; 343 min = (min < 60) ? bin2bcd(min) : 0xff;
344 344
345 sec = t->time.tm_sec; 345 sec = t->time.tm_sec;
346 sec = (sec < 60) ? BIN2BCD(sec) : 0xff; 346 sec = (sec < 60) ? bin2bcd(sec) : 0xff;
347 347
348 spin_lock_irq(&rtc_lock); 348 spin_lock_irq(&rtc_lock);
349 349