Le 9 nov. 08 à 17:19, Geert Uytterhoeven a écrit :
On Thu, 6 Nov 2008, Laurent Vivier wrote:
--- /dev/null
+++ b/drivers/block/swim.c
+static struct platform_device *swim_device;
One global instance?
Yes, why not ? Could you explain ?
+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?
I can rewrite it in C.
Regards,
Laurent
----------------------- Laurent Vivier ----------------------
"The best way to predict the future is to invent it."
- Alan Kay
--
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