hc
2024-05-11 297b60346df8beafee954a0fd7c2d64f33f3b9bc
kernel/arch/sparc/include/asm/floppy_32.h
....@@ -9,8 +9,8 @@
99
1010 #include <linux/of.h>
1111 #include <linux/of_device.h>
12
+#include <linux/pgtable.h>
1213
13
-#include <asm/pgtable.h>
1414 #include <asm/idprom.h>
1515 #include <asm/oplib.h>
1616 #include <asm/auxio.h>
....@@ -59,8 +59,8 @@
5959
6060 static struct sun_floppy_ops sun_fdops;
6161
62
-#define fd_inb(port) sun_fdops.fd_inb(port)
63
-#define fd_outb(value,port) sun_fdops.fd_outb(value,port)
62
+#define fd_inb(base, reg) sun_fdops.fd_inb(reg)
63
+#define fd_outb(value, base, reg) sun_fdops.fd_outb(value, reg)
6464 #define fd_enable_dma() sun_fd_enable_dma()
6565 #define fd_disable_dma() sun_fd_disable_dma()
6666 #define fd_request_dma() (0) /* nothing... */
....@@ -114,15 +114,15 @@
114114 static unsigned char sun_82072_fd_inb(int port)
115115 {
116116 udelay(5);
117
- switch(port & 7) {
117
+ switch (port) {
118118 default:
119119 printk("floppy: Asked to read unknown port %d\n", port);
120120 panic("floppy: Port bolixed.");
121
- case 4: /* FD_STATUS */
121
+ case FD_STATUS:
122122 return sun_fdc->status_82072 & ~STATUS_DMA;
123
- case 5: /* FD_DATA */
123
+ case FD_DATA:
124124 return sun_fdc->data_82072;
125
- case 7: /* FD_DIR */
125
+ case FD_DIR:
126126 return sun_read_dir();
127127 }
128128 panic("sun_82072_fd_inb: How did I get here?");
....@@ -131,20 +131,20 @@
131131 static void sun_82072_fd_outb(unsigned char value, int port)
132132 {
133133 udelay(5);
134
- switch(port & 7) {
134
+ switch (port) {
135135 default:
136136 printk("floppy: Asked to write to unknown port %d\n", port);
137137 panic("floppy: Port bolixed.");
138
- case 2: /* FD_DOR */
138
+ case FD_DOR:
139139 sun_set_dor(value, 0);
140140 break;
141
- case 5: /* FD_DATA */
141
+ case FD_DATA:
142142 sun_fdc->data_82072 = value;
143143 break;
144
- case 7: /* FD_DCR */
144
+ case FD_DCR:
145145 sun_fdc->dcr_82072 = value;
146146 break;
147
- case 4: /* FD_STATUS */
147
+ case FD_DSR:
148148 sun_fdc->status_82072 = value;
149149 break;
150150 }
....@@ -154,23 +154,23 @@
154154 static unsigned char sun_82077_fd_inb(int port)
155155 {
156156 udelay(5);
157
- switch(port & 7) {
157
+ switch (port) {
158158 default:
159159 printk("floppy: Asked to read unknown port %d\n", port);
160160 panic("floppy: Port bolixed.");
161
- case 0: /* FD_STATUS_0 */
161
+ case FD_SRA:
162162 return sun_fdc->status1_82077;
163
- case 1: /* FD_STATUS_1 */
163
+ case FD_SRB:
164164 return sun_fdc->status2_82077;
165
- case 2: /* FD_DOR */
165
+ case FD_DOR:
166166 return sun_fdc->dor_82077;
167
- case 3: /* FD_TDR */
167
+ case FD_TDR:
168168 return sun_fdc->tapectl_82077;
169
- case 4: /* FD_STATUS */
169
+ case FD_STATUS:
170170 return sun_fdc->status_82077 & ~STATUS_DMA;
171
- case 5: /* FD_DATA */
171
+ case FD_DATA:
172172 return sun_fdc->data_82077;
173
- case 7: /* FD_DIR */
173
+ case FD_DIR:
174174 return sun_read_dir();
175175 }
176176 panic("sun_82077_fd_inb: How did I get here?");
....@@ -179,23 +179,23 @@
179179 static void sun_82077_fd_outb(unsigned char value, int port)
180180 {
181181 udelay(5);
182
- switch(port & 7) {
182
+ switch (port) {
183183 default:
184184 printk("floppy: Asked to write to unknown port %d\n", port);
185185 panic("floppy: Port bolixed.");
186
- case 2: /* FD_DOR */
186
+ case FD_DOR:
187187 sun_set_dor(value, 1);
188188 break;
189
- case 5: /* FD_DATA */
189
+ case FD_DATA:
190190 sun_fdc->data_82077 = value;
191191 break;
192
- case 7: /* FD_DCR */
192
+ case FD_DCR:
193193 sun_fdc->dcr_82077 = value;
194194 break;
195
- case 4: /* FD_STATUS */
195
+ case FD_DSR:
196196 sun_fdc->status_82077 = value;
197197 break;
198
- case 3: /* FD_TDR */
198
+ case FD_TDR:
199199 sun_fdc->tapectl_82077 = value;
200200 break;
201201 }