[ARM] use bcd2bin/bin2bcd

This patch changes arm to use the new bcd2bin/bin2bcd functions instead
of the obsolete BCD_TO_BIN/BIN_TO_BCD macros.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
This commit is contained in:
Adrian Bunk 2008-08-08 19:34:35 +03:00 committed by Russell King
parent ae82cbfc8b
commit f1bcf7e3e7

View File

@ -49,12 +49,12 @@ static unsigned long __init get_isa_cmos_time(void)
} while (sec != CMOS_READ(RTC_SECONDS)); } while (sec != CMOS_READ(RTC_SECONDS));
if (!(CMOS_READ(RTC_CONTROL) & RTC_DM_BINARY) || RTC_ALWAYS_BCD) { if (!(CMOS_READ(RTC_CONTROL) & RTC_DM_BINARY) || RTC_ALWAYS_BCD) {
BCD_TO_BIN(sec); sec = bcd2bin(sec);
BCD_TO_BIN(min); min = bcd2bin(min);
BCD_TO_BIN(hour); hour = bcd2bin(hour);
BCD_TO_BIN(day); day = bcd2bin(day);
BCD_TO_BIN(mon); mon = bcd2bin(mon);
BCD_TO_BIN(year); year = bcd2bin(year);
} }
if ((year += 1900) < 1970) if ((year += 1900) < 1970)
year += 100; year += 100;
@ -76,7 +76,7 @@ static int set_isa_cmos_time(void)
cmos_minutes = CMOS_READ(RTC_MINUTES); cmos_minutes = CMOS_READ(RTC_MINUTES);
if (!(save_control & RTC_DM_BINARY) || RTC_ALWAYS_BCD) if (!(save_control & RTC_DM_BINARY) || RTC_ALWAYS_BCD)
BCD_TO_BIN(cmos_minutes); cmos_minutes = bcd2bin(cmos_minutes);
/* /*
* since we're only adjusting minutes and seconds, * since we're only adjusting minutes and seconds,
@ -92,8 +92,8 @@ static int set_isa_cmos_time(void)
if (abs(real_minutes - cmos_minutes) < 30) { if (abs(real_minutes - cmos_minutes) < 30) {
if (!(save_control & RTC_DM_BINARY) || RTC_ALWAYS_BCD) { if (!(save_control & RTC_DM_BINARY) || RTC_ALWAYS_BCD) {
BIN_TO_BCD(real_seconds); real_seconds = bin2bcd(real_seconds);
BIN_TO_BCD(real_minutes); real_minutes = bin2bcd(real_minutes);
} }
CMOS_WRITE(real_seconds,RTC_SECONDS); CMOS_WRITE(real_seconds,RTC_SECONDS);
CMOS_WRITE(real_minutes,RTC_MINUTES); CMOS_WRITE(real_minutes,RTC_MINUTES);