PATCH: run late loaded ide modules

Alan Cox (alan@lxorguk.ukuu.org.uk)
Mon, 14 Jul 2003 13:18:56 +0100


diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.22-pre5/drivers/ide/ide.c linux.22-pre5-ac1/drivers/ide/ide.c
--- linux.22-pre5/drivers/ide/ide.c 2003-07-14 12:27:35.000000000 +0100
+++ linux.22-pre5-ac1/drivers/ide/ide.c 2003-07-09 13:07:39.000000000 +0100
@@ -2221,6 +2221,7 @@
*/

static __initdata ide_driver_call ide_scan[NUM_DRIVER];
+static int drivers_run = 0;

void __init ide_register_driver(ide_driver_call scan)
{
@@ -2228,6 +2229,11 @@
if(ide_scans == NUM_DRIVER)
panic("Too many IDE drivers");
ide_scan[ide_scans++]=scan;
+ if(drivers_run)
+ {
+ printk(KERN_ERR "ide: late registration of driver.\n");
+ scan();
+ }
}

EXPORT_SYMBOL(ide_register_driver);
@@ -2240,6 +2246,7 @@
(ide_scan[i])();
i++;
}
+ drivers_run = 1;
}

/*
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/