diff options
author | Adrian Bunk <bunk@kernel.org> | 2008-08-08 12:34:53 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2008-08-20 02:34:58 -0400 |
commit | 8f6ba49207199cab60a4bdf43507666b93d12e18 (patch) | |
tree | 67c39678d97381a6f7574a345b51f39baaa8fe36 /arch | |
parent | ed95d7450dcbfeb45ffc9d39b1747aee82b49a51 (diff) |
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: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/platforms/chrp/time.c | 24 | ||||
-rw-r--r-- | arch/powerpc/platforms/iseries/mf.c | 26 | ||||
-rw-r--r-- | arch/powerpc/platforms/maple/time.c | 24 |
3 files changed, 37 insertions, 37 deletions
diff --git a/arch/powerpc/platforms/chrp/time.c b/arch/powerpc/platforms/chrp/time.c index 96d1e4b3c493..054dfe5b8e77 100644 --- a/arch/powerpc/platforms/chrp/time.c +++ b/arch/powerpc/platforms/chrp/time.c | |||
@@ -94,12 +94,12 @@ int chrp_set_rtc_time(struct rtc_time *tmarg) | |||
94 | chrp_cmos_clock_write((save_freq_select|RTC_DIV_RESET2), RTC_FREQ_SELECT); | 94 | chrp_cmos_clock_write((save_freq_select|RTC_DIV_RESET2), RTC_FREQ_SELECT); |
95 | 95 | ||
96 | if (!(save_control & RTC_DM_BINARY) || RTC_ALWAYS_BCD) { | 96 | if (!(save_control & RTC_DM_BINARY) || RTC_ALWAYS_BCD) { |
97 | BIN_TO_BCD(tm.tm_sec); | 97 | tm.tm_sec = bin2bcd(tm.tm_sec); |
98 | BIN_TO_BCD(tm.tm_min); | 98 | tm.tm_min = bin2bcd(tm.tm_min); |
99 | BIN_TO_BCD(tm.tm_hour); | 99 | tm.tm_hour = bin2bcd(tm.tm_hour); |
100 | BIN_TO_BCD(tm.tm_mon); | 100 | tm.tm_mon = bin2bcd(tm.tm_mon); |
101 | BIN_TO_BCD(tm.tm_mday); | 101 | tm.tm_mday = bin2bcd(tm.tm_mday); |
102 | BIN_TO_BCD(tm.tm_year); | 102 | tm.tm_year = bin2bcd(tm.tm_year); |
103 | } | 103 | } |
104 | chrp_cmos_clock_write(tm.tm_sec,RTC_SECONDS); | 104 | chrp_cmos_clock_write(tm.tm_sec,RTC_SECONDS); |
105 | chrp_cmos_clock_write(tm.tm_min,RTC_MINUTES); | 105 | chrp_cmos_clock_write(tm.tm_min,RTC_MINUTES); |
@@ -136,12 +136,12 @@ void chrp_get_rtc_time(struct rtc_time *tm) | |||
136 | } while (sec != chrp_cmos_clock_read(RTC_SECONDS)); | 136 | } while (sec != chrp_cmos_clock_read(RTC_SECONDS)); |
137 | 137 | ||
138 | if (!(chrp_cmos_clock_read(RTC_CONTROL) & RTC_DM_BINARY) || RTC_ALWAYS_BCD) { | 138 | if (!(chrp_cmos_clock_read(RTC_CONTROL) & RTC_DM_BINARY) || RTC_ALWAYS_BCD) { |
139 | BCD_TO_BIN(sec); | 139 | sec = bcd2bin(sec); |
140 | BCD_TO_BIN(min); | 140 | min = bcd2bin(min); |
141 | BCD_TO_BIN(hour); | 141 | hour = bcd2bin(hour); |
142 | BCD_TO_BIN(day); | 142 | day = bcd2bin(day); |
143 | BCD_TO_BIN(mon); | 143 | mon = bcd2bin(mon); |
144 | BCD_TO_BIN(year); | 144 | year = bcd2bin(year); |
145 | } | 145 | } |
146 | if (year < 70) | 146 | if (year < 70) |
147 | year += 100; | 147 | year += 100; |
diff --git a/arch/powerpc/platforms/iseries/mf.c b/arch/powerpc/platforms/iseries/mf.c index 731d7b157749..3689c2413d24 100644 --- a/arch/powerpc/platforms/iseries/mf.c +++ b/arch/powerpc/platforms/iseries/mf.c | |||
@@ -722,13 +722,13 @@ static int mf_set_rtc(struct rtc_time *tm) | |||
722 | day = tm->tm_mday; | 722 | day = tm->tm_mday; |
723 | mon = tm->tm_mon + 1; | 723 | mon = tm->tm_mon + 1; |
724 | 724 | ||
725 | BIN_TO_BCD(sec); | 725 | sec = bin2bcd(sec); |
726 | BIN_TO_BCD(min); | 726 | min = bin2bcd(min); |
727 | BIN_TO_BCD(hour); | 727 | hour = bin2bcd(hour); |
728 | BIN_TO_BCD(mon); | 728 | mon = bin2bcd(mon); |
729 | BIN_TO_BCD(day); | 729 | day = bin2bcd(day); |
730 | BIN_TO_BCD(y1); | 730 | y1 = bin2bcd(y1); |
731 | BIN_TO_BCD(y2); | 731 | y2 = bin2bcd(y2); |
732 | 732 | ||
733 | memset(ce_time, 0, sizeof(ce_time)); | 733 | memset(ce_time, 0, sizeof(ce_time)); |
734 | ce_time[3] = 0x41; | 734 | ce_time[3] = 0x41; |
@@ -777,12 +777,12 @@ static int rtc_set_tm(int rc, u8 *ce_msg, struct rtc_time *tm) | |||
777 | u8 day = ce_msg[10]; | 777 | u8 day = ce_msg[10]; |
778 | u8 mon = ce_msg[11]; | 778 | u8 mon = ce_msg[11]; |
779 | 779 | ||
780 | BCD_TO_BIN(sec); | 780 | sec = bcd2bin(sec); |
781 | BCD_TO_BIN(min); | 781 | min = bcd2bin(min); |
782 | BCD_TO_BIN(hour); | 782 | hour = bcd2bin(hour); |
783 | BCD_TO_BIN(day); | 783 | day = bcd2bin(day); |
784 | BCD_TO_BIN(mon); | 784 | mon = bcd2bin(mon); |
785 | BCD_TO_BIN(year); | 785 | year = bcd2bin(year); |
786 | 786 | ||
787 | if (year <= 69) | 787 | if (year <= 69) |
788 | year += 100; | 788 | year += 100; |
diff --git a/arch/powerpc/platforms/maple/time.c b/arch/powerpc/platforms/maple/time.c index 53bca132fb48..eac569dee27c 100644 --- a/arch/powerpc/platforms/maple/time.c +++ b/arch/powerpc/platforms/maple/time.c | |||
@@ -68,12 +68,12 @@ void maple_get_rtc_time(struct rtc_time *tm) | |||
68 | 68 | ||
69 | if (!(maple_clock_read(RTC_CONTROL) & RTC_DM_BINARY) | 69 | if (!(maple_clock_read(RTC_CONTROL) & RTC_DM_BINARY) |
70 | || RTC_ALWAYS_BCD) { | 70 | || RTC_ALWAYS_BCD) { |
71 | BCD_TO_BIN(tm->tm_sec); | 71 | tm->tm_sec = bcd2bin(tm->tm_sec); |
72 | BCD_TO_BIN(tm->tm_min); | 72 | tm->tm_min = bcd2bin(tm->tm_min); |
73 | BCD_TO_BIN(tm->tm_hour); | 73 | tm->tm_hour = bcd2bin(tm->tm_hour); |
74 | BCD_TO_BIN(tm->tm_mday); | 74 | tm->tm_mday = bcd2bin(tm->tm_mday); |
75 | BCD_TO_BIN(tm->tm_mon); | 75 | tm->tm_mon = bcd2bin(tm->tm_mon); |
76 | BCD_TO_BIN(tm->tm_year); | 76 | tm->tm_year = bcd2bin(tm->tm_year); |
77 | } | 77 | } |
78 | if ((tm->tm_year + 1900) < 1970) | 78 | if ((tm->tm_year + 1900) < 1970) |
79 | tm->tm_year += 100; | 79 | tm->tm_year += 100; |
@@ -104,12 +104,12 @@ int maple_set_rtc_time(struct rtc_time *tm) | |||
104 | year = tm->tm_year; | 104 | year = tm->tm_year; |
105 | 105 | ||
106 | if (!(save_control & RTC_DM_BINARY) || RTC_ALWAYS_BCD) { | 106 | if (!(save_control & RTC_DM_BINARY) || RTC_ALWAYS_BCD) { |
107 | BIN_TO_BCD(sec); | 107 | sec = bin2bcd(sec); |
108 | BIN_TO_BCD(min); | 108 | min = bin2bcd(min); |
109 | BIN_TO_BCD(hour); | 109 | hour = bin2bcd(hour); |
110 | BIN_TO_BCD(mon); | 110 | mon = bin2bcd(mon); |
111 | BIN_TO_BCD(mday); | 111 | mday = bin2bcd(mday); |
112 | BIN_TO_BCD(year); | 112 | year = bin2bcd(year); |
113 | } | 113 | } |
114 | maple_clock_write(sec, RTC_SECONDS); | 114 | maple_clock_write(sec, RTC_SECONDS); |
115 | maple_clock_write(min, RTC_MINUTES); | 115 | maple_clock_write(min, RTC_MINUTES); |