Skip to contentSkip to conversation

allow modular built of ide-pnp

PATCH New maximilian attems 1 participant 1 message Jun 26, 2005 libata

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 allow modular built of ide-pnp

From: Christoph Hellwig <[email protected]>

patch is based on previous work of Herbert Xu
and included in current debian kernel images.
allows modular ide-pnp

drivers/ide/Kconfig +1 -1
diff -aurN a/drivers/ide/Kconfig b/drivers/ide/Kconfig
@@ -315,7 +315,7 @@
 	  Otherwise say N.
 
 config BLK_DEV_IDEPNP
-	bool "PNP EIDE support"
+	tristate "PNP EIDE support"
 	depends on PNP
 	help
 	  If you have a PnP (Plug and Play) compatible EIDE card and
drivers/ide/Makefile +1 -1
diff -aurN a/drivers/ide/Makefile b/drivers/ide/Makefile
@@ -22,7 +22,6 @@
 ide-core-$(CONFIG_BLK_DEV_IDEDMA)	+= ide-dma.o
 ide-core-$(CONFIG_BLK_DEV_IDE_TCQ)	+= ide-tcq.o
 ide-core-$(CONFIG_PROC_FS)		+= ide-proc.o
-ide-core-$(CONFIG_BLK_DEV_IDEPNP)	+= ide-pnp.o
 
 # built-in only drivers from arm/
 ide-core-$(CONFIG_IDE_ARM)		+= arm/ide_arm.o
@@ -43,6 +42,7 @@
 
 obj-$(CONFIG_BLK_DEV_IDE)		+= ide-core.o
 obj-$(CONFIG_IDE_GENERIC)		+= ide-generic.o
+obj-$(CONFIG_BLK_DEV_IDEPNP)		+= ide-pnp.o
 
 obj-$(CONFIG_BLK_DEV_IDEDISK)		+= ide-disk.o
 obj-$(CONFIG_BLK_DEV_IDECD)		+= ide-cd.o
drivers/ide/ide-pnp.c +16 -2
diff -aurN a/drivers/ide/ide-pnp.c b/drivers/ide/ide-pnp.c
@@ -69,7 +69,21 @@
 	.remove		= idepnp_remove,
 };
 
-void __init pnpide_init(void)
+int __init pnpide_init(void)
 {
-	pnp_register_driver(&idepnp_driver);
+	return pnp_register_driver(&idepnp_driver);
 }
+
+#ifdef MODULE
+static void __exit pnpide_exit(void)
+{
+       pnp_unregister_driver(&idepnp_driver);
+}
+
+module_init(pnpide_init);
+module_exit(pnpide_exit);
+#endif
+
+MODULE_AUTHOR("Andrey Panin");
+MODULE_DESCRIPTION("Enabler for ISAPNP IDE devices");
+MODULE_LICENSE("GPL");
drivers/ide/ide.c +1 -1
diff -aurN a/drivers/ide/ide.c b/drivers/ide/ide.c
@@ -1789,7 +1789,7 @@
 	return 1;
 }
 
-extern void pnpide_init(void);
+extern int pnpide_init(void);
 extern void h8300_ide_init(void);
 
 /*