diff options
Diffstat (limited to 'arch/m68k/mvme16x')
-rw-r--r-- | arch/m68k/mvme16x/config.c | 15 | ||||
-rw-r--r-- | arch/m68k/mvme16x/rtc.c | 26 |
2 files changed, 18 insertions, 23 deletions
diff --git a/arch/m68k/mvme16x/config.c b/arch/m68k/mvme16x/config.c index 24cbc3030454..1521826fc3c7 100644 --- a/arch/m68k/mvme16x/config.c +++ b/arch/m68k/mvme16x/config.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <linux/types.h> | 17 | #include <linux/types.h> |
18 | #include <linux/kernel.h> | 18 | #include <linux/kernel.h> |
19 | #include <linux/mm.h> | 19 | #include <linux/mm.h> |
20 | #include <linux/seq_file.h> | ||
20 | #include <linux/tty.h> | 21 | #include <linux/tty.h> |
21 | #include <linux/console.h> | 22 | #include <linux/console.h> |
22 | #include <linux/linkage.h> | 23 | #include <linux/linkage.h> |
@@ -42,7 +43,6 @@ extern t_bdid mvme_bdid; | |||
42 | static MK48T08ptr_t volatile rtc = (MK48T08ptr_t)MVME_RTC_BASE; | 43 | static MK48T08ptr_t volatile rtc = (MK48T08ptr_t)MVME_RTC_BASE; |
43 | 44 | ||
44 | static void mvme16x_get_model(char *model); | 45 | static void mvme16x_get_model(char *model); |
45 | static int mvme16x_get_hardware_list(char *buffer); | ||
46 | extern void mvme16x_sched_init(irq_handler_t handler); | 46 | extern void mvme16x_sched_init(irq_handler_t handler); |
47 | extern unsigned long mvme16x_gettimeoffset (void); | 47 | extern unsigned long mvme16x_gettimeoffset (void); |
48 | extern int mvme16x_hwclk (int, struct rtc_time *); | 48 | extern int mvme16x_hwclk (int, struct rtc_time *); |
@@ -93,26 +93,21 @@ static void mvme16x_get_model(char *model) | |||
93 | } | 93 | } |
94 | 94 | ||
95 | 95 | ||
96 | static int mvme16x_get_hardware_list(char *buffer) | 96 | static void mvme16x_get_hardware_list(struct seq_file *m) |
97 | { | 97 | { |
98 | p_bdid p = &mvme_bdid; | 98 | p_bdid p = &mvme_bdid; |
99 | int len = 0; | ||
100 | 99 | ||
101 | if (p->brdno == 0x0162 || p->brdno == 0x0172) | 100 | if (p->brdno == 0x0162 || p->brdno == 0x0172) |
102 | { | 101 | { |
103 | unsigned char rev = *(unsigned char *)MVME162_VERSION_REG; | 102 | unsigned char rev = *(unsigned char *)MVME162_VERSION_REG; |
104 | 103 | ||
105 | len += sprintf (buffer+len, "VMEchip2 %spresent\n", | 104 | seq_printf (m, "VMEchip2 %spresent\n", |
106 | rev & MVME16x_CONFIG_NO_VMECHIP2 ? "NOT " : ""); | 105 | rev & MVME16x_CONFIG_NO_VMECHIP2 ? "NOT " : ""); |
107 | len += sprintf (buffer+len, "SCSI interface %spresent\n", | 106 | seq_printf (m, "SCSI interface %spresent\n", |
108 | rev & MVME16x_CONFIG_NO_SCSICHIP ? "NOT " : ""); | 107 | rev & MVME16x_CONFIG_NO_SCSICHIP ? "NOT " : ""); |
109 | len += sprintf (buffer+len, "Ethernet i/f %spresent\n", | 108 | seq_printf (m, "Ethernet i/f %spresent\n", |
110 | rev & MVME16x_CONFIG_NO_ETHERNET ? "NOT " : ""); | 109 | rev & MVME16x_CONFIG_NO_ETHERNET ? "NOT " : ""); |
111 | } | 110 | } |
112 | else | ||
113 | *buffer = '\0'; | ||
114 | |||
115 | return (len); | ||
116 | } | 111 | } |
117 | 112 | ||
118 | /* | 113 | /* |
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); |