aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc
diff options
context:
space:
mode:
authorSam Ravnborg <sam@ravnborg.org>2012-05-12 04:04:10 -0400
committerDavid S. Miller <davem@davemloft.net>2012-05-12 14:32:02 -0400
commit144e988dd217d8db1c027ef7f1b5a4061a18c874 (patch)
tree4157fca2376af1dc9847db7f25bc1cfff429f245 /arch/sparc
parent918f832290f01b7759826f86bf08562820545e00 (diff)
sparc32: code cleanup in floppy glue
Small cleanup to improve readability. Dropped one test for sparc_cpu_model - we already know that only sun4m support floppy. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc')
-rw-r--r--arch/sparc/include/asm/floppy_32.h17
1 files changed, 8 insertions, 9 deletions
diff --git a/arch/sparc/include/asm/floppy_32.h b/arch/sparc/include/asm/floppy_32.h
index 491eb68c3bb3..c514864cd2e2 100644
--- a/arch/sparc/include/asm/floppy_32.h
+++ b/arch/sparc/include/asm/floppy_32.h
@@ -288,10 +288,11 @@ static int sun_floppy_init(void)
288{ 288{
289 struct platform_device *op; 289 struct platform_device *op;
290 struct device_node *dp; 290 struct device_node *dp;
291 struct resource r;
291 char state[128]; 292 char state[128];
292 phandle tnode, fd_node; 293 phandle fd_node;
294 phandle tnode;
293 int num_regs; 295 int num_regs;
294 struct resource r;
295 296
296 use_virtual_dma = 1; 297 use_virtual_dma = 1;
297 298
@@ -305,19 +306,18 @@ static int sun_floppy_init(void)
305 /* Well, try to find one. */ 306 /* Well, try to find one. */
306 tnode = prom_getchild(prom_root_node); 307 tnode = prom_getchild(prom_root_node);
307 fd_node = prom_searchsiblings(tnode, "obio"); 308 fd_node = prom_searchsiblings(tnode, "obio");
308 if(fd_node != 0) { 309 if (fd_node != 0) {
309 tnode = prom_getchild(fd_node); 310 tnode = prom_getchild(fd_node);
310 fd_node = prom_searchsiblings(tnode, "SUNW,fdtwo"); 311 fd_node = prom_searchsiblings(tnode, "SUNW,fdtwo");
311 } else { 312 } else {
312 fd_node = prom_searchsiblings(tnode, "fd"); 313 fd_node = prom_searchsiblings(tnode, "fd");
313 } 314 }
314 if(fd_node == 0) { 315 if (fd_node == 0) {
315 goto no_sun_fdc; 316 goto no_sun_fdc;
316 } 317 }
317 318
318 /* The sun4m lets us know if the controller is actually usable. */ 319 /* The sun4m lets us know if the controller is actually usable. */
319 if(sparc_cpu_model == sun4m && 320 if (prom_getproperty(fd_node, "status", state, sizeof(state)) != -1) {
320 prom_getproperty(fd_node, "status", state, sizeof(state)) != -1) {
321 if(!strcmp(state, "disabled")) { 321 if(!strcmp(state, "disabled")) {
322 goto no_sun_fdc; 322 goto no_sun_fdc;
323 } 323 }
@@ -328,8 +328,7 @@ static int sun_floppy_init(void)
328 memset(&r, 0, sizeof(r)); 328 memset(&r, 0, sizeof(r));
329 r.flags = fd_regs[0].which_io; 329 r.flags = fd_regs[0].which_io;
330 r.start = fd_regs[0].phys_addr; 330 r.start = fd_regs[0].phys_addr;
331 sun_fdc = (struct sun_flpy_controller *) 331 sun_fdc = of_ioremap(&r, 0, fd_regs[0].reg_size, "floppy");
332 of_ioremap(&r, 0, fd_regs[0].reg_size, "floppy");
333 332
334 /* Look up irq in platform_device. 333 /* Look up irq in platform_device.
335 * We try "SUNW,fdtwo" and "fd" 334 * We try "SUNW,fdtwo" and "fd"
@@ -353,7 +352,7 @@ static int sun_floppy_init(void)
353 FLOPPY_IRQ = op->archdata.irqs[0]; 352 FLOPPY_IRQ = op->archdata.irqs[0];
354 353
355 /* Last minute sanity check... */ 354 /* Last minute sanity check... */
356 if(sun_fdc->status_82072 == 0xff) { 355 if (sun_fdc->status_82072 == 0xff) {
357 sun_fdc = NULL; 356 sun_fdc = NULL;
358 goto no_sun_fdc; 357 goto no_sun_fdc;
359 } 358 }