On Thu, 6 Nov 2008, Laurent Vivier wrote:
--- /dev/null +++ b/drivers/block/swim.c
+static struct platform_device *swim_device;
One global instance?
+static int __devinit swim_probe(struct platform_device *dev) +{ + struct swim *swim_base; + struct swim_priv *swd; + + if (!MACH_IS_MAC) + return -ENODEV; + + switch (macintosh_config->floppy_type) { + case MAC_FLOPPY_SWIM_ADDR1: + swim_base = (struct swim *)(VIA1_BASE + 0x1E000); + break; + case MAC_FLOPPY_SWIM_ADDR2: + swim_base = (struct swim *)(VIA1_BASE + 0x16000); + break; + default: + swim_base = (struct swim *)base; + break; + } + + if (swim_base == NULL) + return -ENODEV; + + printk(KERN_INFO "SWIM base adress 0x%p\n", swim_base); + + /* probe device */ + + set_swim_mode(swim_base, 1); + if (!get_swim_mode(swim_base)) {
get_swim_mode() is also written in assembly. Is plain C not fast enough? If speed matters, what about disabling interrupts here? Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds -- To unsubscribe from this list: send the line "unsubscribe linux-m68k" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html