drivers/block/ll_rw_blk.c | 2 ++ drivers/ide/Makefile | 14 +++++++------- drivers/ide/ide-probe-mini.c | 23 +++++++++++++++++++++++ drivers/ide/ide-probe.c | 20 +++++++++++++------- drivers/ide/ide.c | 32 ++++++-------------------------- include/linux/ide.h | 1 - 6 files changed, 51 insertions(+), 41 deletions(-) diff -puN drivers/block/ll_rw_blk.c~ide-modules drivers/block/ll_rw_blk.c --- linux-2.6.0-test11-bart1/drivers/block/ll_rw_blk.c~ide-modules 2003-12-12 14:10:29.605600968 +0100 +++ linux-2.6.0-test11-bart1-root/drivers/block/ll_rw_blk.c 2003-12-12 14:10:50.736388600 +0100 @@ -145,6 +145,8 @@ void blk_queue_activity_fn(request_queue q->activity_data = data; } +EXPORT_SYMBOL(blk_queue_activity_fn); + /** * blk_queue_prep_rq - set a prepare_request function for queue * @q: queue diff -puN drivers/ide/ide.c~ide-modules drivers/ide/ide.c --- linux-2.6.0-test11-bart1/drivers/ide/ide.c~ide-modules 2003-12-12 14:10:13.949980984 +0100 +++ linux-2.6.0-test11-bart1-root/drivers/ide/ide.c 2003-12-12 14:10:13.968978096 +0100 @@ -189,9 +189,6 @@ int noautodma = 1; #endif EXPORT_SYMBOL(noautodma); -EXPORT_SYMBOL(ide_bus_type); - -int (*ide_probe)(void); /* * This is declared extern in ide.h, for access by other IDE modules: @@ -443,21 +440,6 @@ u8 ide_dump_status (ide_drive_t *drive, EXPORT_SYMBOL(ide_dump_status); - - -void ide_probe_module (void) -{ - if (!ide_probe) { -#if defined(CONFIG_KMOD) && defined(CONFIG_BLK_DEV_IDE_MODULE) - (void) request_module("ide-probe-mod"); -#endif /* (CONFIG_KMOD) && (CONFIG_BLK_DEV_IDE_MODULE) */ - } else { - (void)ide_probe(); - } -} - -EXPORT_SYMBOL(ide_probe_module); - static int ide_open (struct inode * inode, struct file * filp) { return -ENXIO; @@ -585,8 +567,6 @@ control_region_busy: return -EBUSY; } -EXPORT_SYMBOL(ide_hwif_request_regions); - /** * ide_hwif_release_regions - free IDE resources * @@ -622,8 +602,6 @@ void ide_hwif_release_regions(ide_hwif_t } } -EXPORT_SYMBOL(ide_hwif_release_regions); - extern void init_hwif_data(unsigned int index); /** @@ -992,6 +970,8 @@ void ide_setup_ports ( hw_regs_t *hw, EXPORT_SYMBOL(ide_setup_ports); +extern int ideprobe_init_module(void); + /* * Register an IDE interface, specifying exactly the registers etc * Set init=1 iff calling before probes have taken place. @@ -1033,7 +1013,10 @@ found: hwif->chipset = hw->chipset; if (!initializing) { - ide_probe_module(); +#ifdef MODULE + if (ideprobe_init_module() == -EBUSY) +#endif + ideprobe_init(); #ifdef CONFIG_PROC_FS create_proc_ide_interfaces(); #endif @@ -1517,8 +1500,6 @@ int ata_attach(ide_drive_t *drive) return 1; } -EXPORT_SYMBOL(ata_attach); - static int generic_ide_suspend(struct device *dev, u32 state) { ide_drive_t *drive = dev->driver_data; @@ -2564,7 +2545,6 @@ EXPORT_SYMBOL(ide_fops); */ EXPORT_SYMBOL(ide_lock); -EXPORT_SYMBOL(ide_probe); struct bus_type ide_bus_type = { .name = "ide", diff -puN drivers/ide/ide-probe.c~ide-modules drivers/ide/ide-probe.c --- linux-2.6.0-test11-bart1/drivers/ide/ide-probe.c~ide-modules 2003-12-12 14:10:13.943981896 +0100 +++ linux-2.6.0-test11-bart1-root/drivers/ide/ide-probe.c 2003-12-12 14:10:13.964978704 +0100 @@ -1348,27 +1348,33 @@ int ideprobe_init (void) ata_attach(&hwif->drives[unit]); } } - if (!ide_probe) - ide_probe = &ideprobe_init; MOD_DEC_USE_COUNT; return 0; } #ifdef MODULE -int init_module (void) +static int ideprobe_done; + +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 = 1; return 0; } -void cleanup_module (void) +EXPORT_SYMBOL_GPL(ideprobe_init_module); + +void ideprobe_cleanup_module(void) { - ide_probe = NULL; } -MODULE_LICENSE("GPL"); + +EXPORT_SYMBOL_GPL(ideprobe_cleanup_module); #endif /* MODULE */ diff -puN /dev/null drivers/ide/ide-probe-mini.c --- /dev/null 2003-01-30 11:24:37.000000000 +0100 +++ linux-2.6.0-test11-bart1-root/drivers/ide/ide-probe-mini.c 2003-12-12 14:10:13.965978552 +0100 @@ -0,0 +1,23 @@ +/* + * linux/drivers/ide/ide-probe-mini.c Version 1 + * + * Copyright (C) 1994-1998 Linus Torvalds & authors (see below) + */ + +#include +#include +#include +#include +#include +#include +#include + +#ifdef MODULE +extern int ideprobe_init_module(void); +extern void ideprobe_cleanup_module(void); + +module_init(ideprobe_init_module); +module_exit(ideprobe_cleanup_module); + +MODULE_LICENSE("GPL"); +#endif diff -puN drivers/ide/Makefile~ide-modules drivers/ide/Makefile --- linux-2.6.0-test11-bart1/drivers/ide/Makefile~ide-modules 2003-12-12 14:10:13.946981440 +0100 +++ linux-2.6.0-test11-bart1-root/drivers/ide/Makefile 2003-12-12 14:24:35.073070376 +0100 @@ -10,22 +10,22 @@ # First come modules that register themselves with the core obj-$(CONFIG_BLK_DEV_IDE) += pci/ +ide-core-objs := ide-io.o ide-probe.o ide-iops.o ide-taskfile.o ide.o ide-lib.o ide-default.o + # Core IDE code - must come before legacy +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) += ide-io.o ide-probe.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 -ifeq ($(CONFIG_BLK_DEV_IDE),y) -obj-$(CONFIG_PROC_FS) += ide-proc.o -endif +obj-$(CONFIG_BLK_DEV_IDE) += ide-core.o ide-probe-mini.o obj-$(CONFIG_BLK_DEV_IDE) += legacy/ ppc/ arm/ obj-$(CONFIG_BLK_DEV_HD) += legacy/ diff -puN include/linux/ide.h~ide-modules include/linux/ide.h --- linux-2.6.0-test11-bart1/include/linux/ide.h~ide-modules 2003-12-12 14:10:13.960979312 +0100 +++ linux-2.6.0-test11-bart1-root/include/linux/ide.h 2003-12-12 14:10:13.969977944 +0100 @@ -1238,7 +1238,6 @@ typedef struct ide_devices_s { */ #ifndef _IDE_C extern ide_hwif_t ide_hwifs[]; /* master data repository */ -extern int (*ide_probe)(void); extern ide_devices_t *idedisk; extern ide_devices_t *idecd;