Skip to contentSkip to conversation

module ide-pnp

PATCH In review Christoph Hellwig 1 participant 2 messages Jun 19, 2004 libata

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 module ide-pnp

This patch allows compile ide-pnp as a module. The original patch is from Herbert Xu through the Debian kernel package, but I reworked it significantly.

drivers/ide/Kconfig +1 -1
@@ -305,7 +305,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/ide-pnp.c +16 -2
@@ -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
@@ -2003,7 +2003,7 @@
 	return 1;
 }
 
-extern void pnpide_init(void);
+extern int pnpide_init(void);
 extern void h8300_ide_init(void);
 
 /*
#1 lore raw
Quoted 3 lines · Christoph Hellwig

This patch allows compile ide-pnp as a module. The original patch is from Herbert Xu through the Debian kernel package, but I reworked it significantly.

oops, makefile bits missing:

drivers/ide/Makefile +1 -1
@@ -23,7 +23,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
@@ -44,6 +43,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