]> err.no Git - linux-2.6/commitdiff
ide: unregister idepnp driver on unload
authorTejun Heo <htejun@gmail.com>
Sat, 27 Jan 2007 12:47:02 +0000 (13:47 +0100)
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Sat, 27 Jan 2007 12:47:02 +0000 (13:47 +0100)
idepnp driver is registered as a pnp driver on ide init but doesn't
get unregistered on ide unload causing driver list corruption and
eventually oops.  Fix it.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
drivers/ide/ide-pnp.c
drivers/ide/ide.c

index df7d1504f84ef0d4d32058e42d82e93f653f7a5a..98410ca044cfc4c21a50f430f930a322588ab96c 100644 (file)
@@ -73,3 +73,8 @@ void __init pnpide_init(void)
 {
        pnp_register_driver(&idepnp_driver);
 }
+
+void __exit pnpide_exit(void)
+{
+       pnp_unregister_driver(&idepnp_driver);
+}
index 16890769dca686dff62ec62bc0c2f741b7ef190c..3b334af0c7b98d1cb39ae07ec5e714998f385102 100644 (file)
@@ -1782,6 +1782,7 @@ done:
 }
 
 extern void pnpide_init(void);
+extern void pnpide_exit(void);
 extern void h8300_ide_init(void);
 
 /*
@@ -2094,6 +2095,10 @@ void cleanup_module (void)
        for (index = 0; index < MAX_HWIFS; ++index)
                ide_unregister(index);
 
+#ifdef CONFIG_BLK_DEV_IDEPNP
+       pnpide_exit();
+#endif
+
 #ifdef CONFIG_PROC_FS
        proc_ide_destroy();
 #endif