Commit 8f6ba492 authored by Adrian Bunk's avatar Adrian Bunk Committed by Paul Mackerras

powerpc: Use bcd2bin/bin2bcd

This changes powerpc to use the new bcd2bin/bin2bcd functions
instead of the obsolete BCD_TO_BIN/BIN_TO_BCD macros.
Signed-off-by: default avatarAdrian Bunk <bunk@kernel.org>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent ed95d745
...@@ -94,12 +94,12 @@ int chrp_set_rtc_time(struct rtc_time *tmarg) ...@@ -94,12 +94,12 @@ int chrp_set_rtc_time(struct rtc_time *tmarg)
chrp_cmos_clock_write((save_freq_select|RTC_DIV_RESET2), RTC_FREQ_SELECT); chrp_cmos_clock_write((save_freq_select|RTC_DIV_RESET2), RTC_FREQ_SELECT);
if (!(save_control & RTC_DM_BINARY) || RTC_ALWAYS_BCD) { if (!(save_control & RTC_DM_BINARY) || RTC_ALWAYS_BCD) {
BIN_TO_BCD(tm.tm_sec); tm.tm_sec = bin2bcd(tm.tm_sec);
BIN_TO_BCD(tm.tm_min); tm.tm_min = bin2bcd(tm.tm_min);
BIN_TO_BCD(tm.tm_hour); tm.tm_hour = bin2bcd(tm.tm_hour);
BIN_TO_BCD(tm.tm_mon); tm.tm_mon = bin2bcd(tm.tm_mon);
BIN_TO_BCD(tm.tm_mday); tm.tm_mday = bin2bcd(tm.tm_mday);
BIN_TO_BCD(tm.tm_year); tm.tm_year = bin2bcd(tm.tm_year);
} }
chrp_cmos_clock_write(tm.tm_sec,RTC_SECONDS); chrp_cmos_clock_write(tm.tm_sec,RTC_SECONDS);
chrp_cmos_clock_write(tm.tm_min,RTC_MINUTES); chrp_cmos_clock_write(tm.tm_min,RTC_MINUTES);
...@@ -136,12 +136,12 @@ void chrp_get_rtc_time(struct rtc_time *tm) ...@@ -136,12 +136,12 @@ void chrp_get_rtc_time(struct rtc_time *tm)
} while (sec != chrp_cmos_clock_read(RTC_SECONDS)); } while (sec != chrp_cmos_clock_read(RTC_SECONDS));
if (!(chrp_cmos_clock_read(RTC_CONTROL) & RTC_DM_BINARY) || RTC_ALWAYS_BCD) { if (!(chrp_cmos_clock_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 < 70) if (year < 70)
year += 100; year += 100;
......
...@@ -722,13 +722,13 @@ static int mf_set_rtc(struct rtc_time *tm) ...@@ -722,13 +722,13 @@ static int mf_set_rtc(struct rtc_time *tm)
day = tm->tm_mday; day = tm->tm_mday;
mon = tm->tm_mon + 1; mon = tm->tm_mon + 1;
BIN_TO_BCD(sec); sec = bin2bcd(sec);
BIN_TO_BCD(min); min = bin2bcd(min);
BIN_TO_BCD(hour); hour = bin2bcd(hour);
BIN_TO_BCD(mon); mon = bin2bcd(mon);
BIN_TO_BCD(day); day = bin2bcd(day);
BIN_TO_BCD(y1); y1 = bin2bcd(y1);
BIN_TO_BCD(y2); y2 = bin2bcd(y2);
memset(ce_time, 0, sizeof(ce_time)); memset(ce_time, 0, sizeof(ce_time));
ce_time[3] = 0x41; ce_time[3] = 0x41;
...@@ -777,12 +777,12 @@ static int rtc_set_tm(int rc, u8 *ce_msg, struct rtc_time *tm) ...@@ -777,12 +777,12 @@ static int rtc_set_tm(int rc, u8 *ce_msg, struct rtc_time *tm)
u8 day = ce_msg[10]; u8 day = ce_msg[10];
u8 mon = ce_msg[11]; u8 mon = ce_msg[11];
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 <= 69) if (year <= 69)
year += 100; year += 100;
......
...@@ -68,12 +68,12 @@ void maple_get_rtc_time(struct rtc_time *tm) ...@@ -68,12 +68,12 @@ void maple_get_rtc_time(struct rtc_time *tm)
if (!(maple_clock_read(RTC_CONTROL) & RTC_DM_BINARY) if (!(maple_clock_read(RTC_CONTROL) & RTC_DM_BINARY)
|| RTC_ALWAYS_BCD) { || RTC_ALWAYS_BCD) {
BCD_TO_BIN(tm->tm_sec); tm->tm_sec = bcd2bin(tm->tm_sec);
BCD_TO_BIN(tm->tm_min); tm->tm_min = bcd2bin(tm->tm_min);
BCD_TO_BIN(tm->tm_hour); tm->tm_hour = bcd2bin(tm->tm_hour);
BCD_TO_BIN(tm->tm_mday); tm->tm_mday = bcd2bin(tm->tm_mday);
BCD_TO_BIN(tm->tm_mon); tm->tm_mon = bcd2bin(tm->tm_mon);
BCD_TO_BIN(tm->tm_year); tm->tm_year = bcd2bin(tm->tm_year);
} }
if ((tm->tm_year + 1900) < 1970) if ((tm->tm_year + 1900) < 1970)
tm->tm_year += 100; tm->tm_year += 100;
...@@ -104,12 +104,12 @@ int maple_set_rtc_time(struct rtc_time *tm) ...@@ -104,12 +104,12 @@ int maple_set_rtc_time(struct rtc_time *tm)
year = tm->tm_year; year = tm->tm_year;
if (!(save_control & RTC_DM_BINARY) || RTC_ALWAYS_BCD) { if (!(save_control & RTC_DM_BINARY) || RTC_ALWAYS_BCD) {
BIN_TO_BCD(sec); sec = bin2bcd(sec);
BIN_TO_BCD(min); min = bin2bcd(min);
BIN_TO_BCD(hour); hour = bin2bcd(hour);
BIN_TO_BCD(mon); mon = bin2bcd(mon);
BIN_TO_BCD(mday); mday = bin2bcd(mday);
BIN_TO_BCD(year); year = bin2bcd(year);
} }
maple_clock_write(sec, RTC_SECONDS); maple_clock_write(sec, RTC_SECONDS);
maple_clock_write(min, RTC_MINUTES); maple_clock_write(min, RTC_MINUTES);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment