Skip to contentSkip to conversation

Modular IDE

PATCH Taral 1 participant 1 message May 12, 2003

Subsystems (2)
lore
Share & tools
lore

Taral

author
#0 lore raw

I've managed to shoe-horn IDE into compiling itself as a module... Patch is attached. Any comments?

Signature · 4 lines
Taral <[email protected]>
This message is digitally signed. Please PGP encrypt mail to me.
"Most parents have better things to do with their time than take care of
their children." -- Me
drivers/ide/Makefile +11 -7
diff -Nru a/drivers/ide/Makefile b/drivers/ide/Makefile
@@ -12,19 +12,23 @@
 
 # Core IDE code - must come before legacy
 
-obj-$(CONFIG_BLK_DEV_IDE)		+= ide-io.o ide-probe.o ide-geometry.o ide-iops.o ide-taskfile.o ide.o ide-lib.o ide-default.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
-
+ide-mod-y					:= ide-probe.o ide-io.o ide-geometry.o ide-iops.o ide-taskfile.o ide.o ide-lib.o ide-default.o
+ide-mod-n					:=
+ide-mod-$(CONFIG_PROC_FS)			+= ide-proc.o
+ide-mod-$(CONFIG_BLK_DEV_IDEPCI)		+= setup-pci.o
+ide-mod-$(CONFIG_BLK_DEV_IDEDMA_PCI)	+= ide-dma.o
+ide-mod-$(CONFIG_BLK_DEV_IDE_TCQ)		+= ide-tcq.o
+ide-mod-$(CONFIG_BLK_DEV_IDEPNP)		+= ide-pnp.o
 ifeq ($(CONFIG_BLK_DEV_IDE),y)
-obj-$(CONFIG_PROC_FS)			+= ide-proc.o
+obj-y += $(ide-mod-y)
+endif
+ifeq ($(CONFIG_BLK_DEV_IDE),m)
+obj-m += ide-mod.o
 endif
 
 obj-$(CONFIG_BLK_DEV_IDE)		+= legacy/ ppc/ arm/
drivers/ide/ide-default.c +0 -4
diff -Nru a/drivers/ide/ide-default.c b/drivers/ide/ide-default.c
@@ -65,7 +65,3 @@
 	}
 	return 0;
 }
-
-MODULE_DESCRIPTION("IDE Default Driver");
-
-MODULE_LICENSE("GPL");
drivers/ide/ide-geometry.c +3 -1
diff -Nru a/drivers/ide/ide-geometry.c b/drivers/ide/ide-geometry.c
@@ -2,6 +2,7 @@
  * linux/drivers/ide/ide-geometry.c
  */
 #include <linux/config.h>
+#include <linux/module.h>
 #include <linux/ide.h>
 #include <linux/mc146818rtc.h>
 #include <asm/io.h>
@@ -69,7 +70,7 @@
  * Returns 1 if the geometry translation was successful.
  */
 
-int ide_xlate_1024 (struct block_device *bdev, int xparm, int ptheads, const char *msg)
+int ide_xlate_1024(struct block_device *bdev, int xparm, int ptheads, const char *msg)
 {
 	ide_drive_t *drive = bdev->bd_disk->private_data;
 	const char *msg1 = "";
@@ -133,3 +134,4 @@
 		       drive->bios_cyl, drive->bios_head, drive->bios_sect);
 	return ret;
 }
+EXPORT_SYMBOL(ide_xlate_1024);
drivers/ide/ide-io.c +1 -11
diff -Nru a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
@@ -577,7 +577,7 @@
  *	FIXME: this function needs a rename
  */
  
-ide_startstop_t start_request (ide_drive_t *drive, struct request *rq)
+static ide_startstop_t start_request (ide_drive_t *drive, struct request *rq)
 {
 	ide_startstop_t startstop;
 	unsigned long block;
@@ -633,8 +633,6 @@
 	return ide_stopped;
 }
 
-EXPORT_SYMBOL(start_request);
-
 /**
  *	ide_stall_queue		-	pause an IDE device
  *	@drive: drive to stall
@@ -867,14 +865,6 @@
 }
 
 EXPORT_SYMBOL(ide_do_request);
-
-/*
- * Passes the stuff to ide_do_request
- */
-void do_ide_request(request_queue_t *q)
-{
-	ide_do_request(q->queuedata, IDE_NO_IRQ);
-}
 
 /*
  * un-busy the hwgroup etc, and clear any pending DMA status. we want to
drivers/ide/ide-probe.c +9 -46

97 lines not on this page · raw message

drivers/ide/ide.c +3 -2
diff -Nru a/drivers/ide/ide.c b/drivers/ide/ide.c
@@ -178,6 +178,7 @@
 static int initializing;	/* set while initializing built-in drivers */
 
 DECLARE_MUTEX(ide_cfg_sem);
+EXPORT_SYMBOL(ide_cfg_sem);
 spinlock_t ide_lock __cacheline_aligned_in_smp = SPIN_LOCK_UNLOCKED;
 
 static int ide_scan_direction; /* THIS was formerly 2.2.x pci=reverse */
@@ -1355,6 +1356,7 @@
 	if (drive->media != ide_disk)
 		ide_add_setting(drive,	"ide-scsi",		SETTING_RW,					-1,		HDIO_SET_IDE_SCSI,		TYPE_BYTE,	0,	1,				1,		1,		&drive->scsi,			ide_atapi_to_scsi);
 }
+EXPORT_SYMBOL(ide_add_generic_settings);
 
 /*
  * Delay for *at least* 50ms.  As we don't know how much time is left
@@ -2185,7 +2187,6 @@
 	 */
 	probe_for_hwifs ();
 
-#ifdef CONFIG_BLK_DEV_IDE
 	if (ide_hwifs[0].io_ports[IDE_DATA_OFFSET])
 		ide_get_lock(NULL, NULL); /* for atari only */
 
@@ -2193,7 +2194,6 @@
 
 	if (ide_hwifs[0].io_ports[IDE_DATA_OFFSET])
 		ide_release_lock();	/* for atari only */
-#endif /* CONFIG_BLK_DEV_IDE */
 
 #ifdef CONFIG_PROC_FS
 	proc_ide_create();
@@ -2456,6 +2456,7 @@
 struct bus_type ide_bus_type = {
 	.name		= "ide",
 };
+EXPORT_SYMBOL(ide_bus_type);
 
 /*
  * This is gets invoked once during initialization, to set *everything* up
drivers/pci/pci.c +1 -0
diff -Nru a/drivers/pci/pci.c b/drivers/pci/pci.c
@@ -736,6 +736,7 @@
 EXPORT_SYMBOL(isa_bridge);
 #endif
 
+EXPORT_SYMBOL(pci_enable_device_bars);
 EXPORT_SYMBOL(pci_enable_device);
 EXPORT_SYMBOL(pci_disable_device);
 EXPORT_SYMBOL(pci_max_busnr);