linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] 2.6.0-test11 IDE modularisation.
@ 2003-11-28 19:48 Gertjan van Wingerde
  0 siblings, 0 replies; only message in thread
From: Gertjan van Wingerde @ 2003-11-28 19:48 UTC (permalink / raw)
  To: B.Zolnierkiewicz; +Cc: linux-kernel

Hi Bart,

Kernel 2.6.0-test11 suffers from the same IDE modularisation issues as the ones that got fixed in 2.4.23.
The patches below fixes this issue in the same manner as 2.4.23 does and work for me. 

	MvG,

		Gertjan.

[ll_rw_blk.c export, necessary for IDE module]

diff -u --recursive linux-2.6.x-original/drivers/block/ll_rw_blk.c linux-2.6.x/drivers/block/ll_rw_blk.c
--- linux-2.6.x-original/drivers/block/ll_rw_blk.c	2003-11-24 21:27:45.000000000 +0100
+++ linux-2.6.x/drivers/block/ll_rw_blk.c	2003-11-24 21:27:06.000000000 +0100
@@ -145,6 +145,8 @@
 	q->activity_data = data;
 }
 
+EXPORT_SYMBOL(blk_queue_activity_fn);
+
 /**
  * blk_queue_prep_rq - set a prepare_request function for queue
  * @q:		queue

[IDE modularisation changes]

diff -u --recursive --new-file linux-2.6.x-original/drivers/ide/Makefile linux-2.6.x/drivers/ide/Makefile
--- linux-2.6.x-original/drivers/ide/Makefile	2003-10-25 20:43:39.000000000 +0200
+++ linux-2.6.x/drivers/ide/Makefile	2003-11-26 00:43:19.000000000 +0100
@@ -12,20 +12,18 @@
 
 # Core IDE code - must come before legacy
 
-obj-$(CONFIG_BLK_DEV_IDE)		+= ide-io.o ide-probe.o ide-iops.o ide-taskfile.o ide.o ide-lib.o ide-default.o
+obj-$(CONFIG_BLK_DEV_IDE)		+= ide-core.o ide-detect.o
 obj-$(CONFIG_BLK_DEV_IDEDISK)		+= ide-disk.o
 obj-$(CONFIG_BLK_DEV_IDECD)		+= ide-cd.o
 obj-$(CONFIG_BLK_DEV_IDETAPE)		+= ide-tape.o
 obj-$(CONFIG_BLK_DEV_IDEFLOPPY)		+= ide-floppy.o
 
-obj-$(CONFIG_BLK_DEV_IDEPCI)		+= setup-pci.o
-obj-$(CONFIG_BLK_DEV_IDEDMA_PCI)	+= ide-dma.o
-obj-$(CONFIG_BLK_DEV_IDE_TCQ)		+= ide-tcq.o
-obj-$(CONFIG_BLK_DEV_IDEPNP)		+= ide-pnp.o
-
-ifeq ($(CONFIG_BLK_DEV_IDE),y)
-obj-$(CONFIG_PROC_FS)			+= ide-proc.o
-endif
+ide-core-y				:= ide-io.o ide-probe.o ide-iops.o ide-taskfile.o ide.o ide-lib.o ide-default.o
+ide-core-$(CONFIG_BLK_DEV_IDEPNP)	+= ide-pnp.o
+ide-core-$(CONFIG_BLK_DEV_IDEPCI)	+= setup-pci.o
+ide-core-$(CONFIG_BLK_DEV_IDEDMA_PCI)	+= ide-dma.o
+ide-core-$(CONFIG_BLK_DEV_IDE_TCQ)	+= ide-tcq.o
+ide-core-$(CONFIG_PROC_FS) 		+= ide-proc.o
 
 obj-$(CONFIG_BLK_DEV_IDE)		+= legacy/ ppc/ arm/
 obj-$(CONFIG_BLK_DEV_HD)		+= legacy/
diff -u --recursive --new-file linux-2.6.x-original/drivers/ide/ide-detect.c linux-2.6.x/drivers/ide/ide-detect.c
--- linux-2.6.x-original/drivers/ide/ide-detect.c	1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.x/drivers/ide/ide-detect.c	2003-11-26 00:49:51.000000000 +0100
@@ -0,0 +1,29 @@
+/*
+ *  linux/drivers/ide/ide-detect.c	Version 1
+ *
+ *  Copyright (C) 1994-1998  Linus Torvalds & authors (see below)
+ */
+
+#include <linux/config.h>
+#include <linux/module.h>
+#include <linux/types.h>
+#include <linux/string.h>
+#include <linux/kernel.h>
+#include <linux/kmod.h>
+
+#ifdef MODULE
+extern int ideprobe_init_module(void);
+
+int init_module (void)
+{
+    return ideprobe_init_module();
+}
+
+extern void ideprobe_cleanup_module(void);
+
+void cleanup_module (void)
+{
+    ideprobe_cleanup_module();
+}
+MODULE_LICENSE("GPL");
+#endif /* MODULE */
diff -u --recursive --new-file linux-2.6.x-original/drivers/ide/ide-probe.c linux-2.6.x/drivers/ide/ide-probe.c
--- linux-2.6.x-original/drivers/ide/ide-probe.c	2003-10-25 20:43:52.000000000 +0200
+++ linux-2.6.x/drivers/ide/ide-probe.c	2003-11-26 00:54:26.000000000 +0100
@@ -1355,20 +1355,31 @@
 }
 
 #ifdef MODULE
-int init_module (void)
+static int ideprobe_done = 0;
+
+int ideprobe_init_module (void)
 {
 	unsigned int index;
+
+	if (ideprobe_done)
+		return -EBUSY;
 	
 	for (index = 0; index < MAX_HWIFS; ++index)
 		ide_unregister(index);
 	ideprobe_init();
 	create_proc_ide_interfaces();
+	ideprobe_done++;
 	return 0;
 }
 
-void cleanup_module (void)
+EXPORT_SYMBOL(ideprobe_init_module);
+
+void ideprobe_cleanup_module (void)
 {
 	ide_probe = NULL;
 }
+
+EXPORT_SYMBOL(ideprobe_cleanup_module);
+
 MODULE_LICENSE("GPL");
 #endif /* MODULE */


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-11-28 19:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-28 19:48 [PATCH] 2.6.0-test11 IDE modularisation Gertjan van Wingerde

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).