diff options
author | Adrian Bunk <bunk@kernel.org> | 2008-10-13 15:58:47 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-14 13:23:26 -0400 |
commit | 5b1d5f953bbb50dcbdf93719cb622aa128ba7527 (patch) | |
tree | d1f826b007e909bbf340498376c83a0452359af4 /arch/m68k/mvme16x | |
parent | 4aba41ea8bdc1b475861f5e5c1649ab20251090c (diff) |
m68k: use bcd2bin/bin2bcd
This patch changes m68k to use the new bcd2bin/bin2bcd functions instead
of the obsolete BCD_TO_BIN/BIN_TO_BCD/BCD2BIN/BIN2BCD macros.
It also remove local bcd2bin/bin2bcd implementations
in favor of the global ones.
Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/m68k/mvme16x')
-rw-r--r-- | arch/m68k/mvme16x/rtc.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/arch/m68k/mvme16x/rtc.c b/arch/m68k/mvme16x/rtc.c index 432a9f13b2ed..cea5e3e4e636 100644 --- a/arch/m68k/mvme16x/rtc.c +++ b/arch/m68k/mvme16x/rtc.c | |||
@@ -52,15 +52,15 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, | |||
52 | /* Ensure clock and real-time-mode-register are accessible */ | 52 | /* Ensure clock and real-time-mode-register are accessible */ |
53 | rtc->ctrl = RTC_READ; | 53 | rtc->ctrl = RTC_READ; |
54 | memset(&wtime, 0, sizeof(struct rtc_time)); | 54 | memset(&wtime, 0, sizeof(struct rtc_time)); |
55 | wtime.tm_sec = BCD2BIN(rtc->bcd_sec); | 55 | wtime.tm_sec = bcd2bin(rtc->bcd_sec); |
56 | wtime.tm_min = BCD2BIN(rtc->bcd_min); | 56 | wtime.tm_min = bcd2bin(rtc->bcd_min); |
57 | wtime.tm_hour = BCD2BIN(rtc->bcd_hr); | 57 | wtime.tm_hour = bcd2bin(rtc->bcd_hr); |
58 | wtime.tm_mday = BCD2BIN(rtc->bcd_dom); | 58 | wtime.tm_mday = bcd2bin(rtc->bcd_dom); |
59 | wtime.tm_mon = BCD2BIN(rtc->bcd_mth)-1; | 59 | wtime.tm_mon = bcd2bin(rtc->bcd_mth)-1; |
60 | wtime.tm_year = BCD2BIN(rtc->bcd_year); | 60 | wtime.tm_year = bcd2bin(rtc->bcd_year); |
61 | if (wtime.tm_year < 70) | 61 | if (wtime.tm_year < 70) |
62 | wtime.tm_year += 100; | 62 | wtime.tm_year += 100; |
63 | wtime.tm_wday = BCD2BIN(rtc->bcd_dow)-1; | 63 | wtime.tm_wday = bcd2bin(rtc->bcd_dow)-1; |
64 | rtc->ctrl = 0; | 64 | rtc->ctrl = 0; |
65 | local_irq_restore(flags); | 65 | local_irq_restore(flags); |
66 | return copy_to_user(argp, &wtime, sizeof wtime) ? | 66 | return copy_to_user(argp, &wtime, sizeof wtime) ? |
@@ -104,12 +104,12 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, | |||
104 | local_irq_save(flags); | 104 | local_irq_save(flags); |
105 | rtc->ctrl = RTC_WRITE; | 105 | rtc->ctrl = RTC_WRITE; |
106 | 106 | ||
107 | rtc->bcd_sec = BIN2BCD(sec); | 107 | rtc->bcd_sec = bin2bcd(sec); |
108 | rtc->bcd_min = BIN2BCD(min); | 108 | rtc->bcd_min = bin2bcd(min); |
109 | rtc->bcd_hr = BIN2BCD(hrs); | 109 | rtc->bcd_hr = bin2bcd(hrs); |
110 | rtc->bcd_dom = BIN2BCD(day); | 110 | rtc->bcd_dom = bin2bcd(day); |
111 | rtc->bcd_mth = BIN2BCD(mon); | 111 | rtc->bcd_mth = bin2bcd(mon); |
112 | rtc->bcd_year = BIN2BCD(yrs%100); | 112 | rtc->bcd_year = bin2bcd(yrs%100); |
113 | 113 | ||
114 | rtc->ctrl = 0; | 114 | rtc->ctrl = 0; |
115 | local_irq_restore(flags); | 115 | local_irq_restore(flags); |