linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Martin Dalecki <dalecki@evision-ventures.com>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: [PATCH] 2.5.5-pre1 IDE cleanup 9
Date: Tue, 19 Feb 2002 12:46:29 +0100	[thread overview]
Message-ID: <3C723B15.2030409@evision-ventures.com> (raw)
In-Reply-To: <Pine.LNX.4.33.0202131434350.21395-100000@home.transmeta.com>

[-- Attachment #1: Type: text/plain, Size: 1118 bytes --]

The attached patch does the following:

1.  Kill the ide-probe-mod by merging it with ide-mod. There is *really*
     no reaons for having this stuff split up into two different
    modules unless you wan't to create artificial module dependancies 
and waste space
    of page boundaries during memmory allocation for the modules

2. Kill the ide_module_t - which is unnecessary and presents a 
"reimplementation"
   of module handling inside the  ide driver. This is achieved by 
attaching the
   initialization routine ot the ide_driver_t, which will be gone next 
time,
   since there is no sane reason apparently, which this couldn't be done
   during the module-generic initialization of the corresponding driver 
module.

3. Kill unnecessary tagging of "subdriver" with IDE_SUBDRIVER_VERSION - we
   have plenty of other mechanisms for module consistency checking. And 
anyway
   the ide code didn't any consistence checks on this  value at all.

NOTE: The ide_(un)register_module() functions will be killed in next round.

This patch should apply to mainstream, however it waws created on top of 
the others.



[-- Attachment #2: ide-clean-9.diff --]
[-- Type: text/plain, Size: 20002 bytes --]

diff -ur linux-2.5.4/drivers/ide/Makefile linux/drivers/ide/Makefile
--- linux-2.5.4/drivers/ide/Makefile	Mon Feb 11 02:50:09 2002
+++ linux/drivers/ide/Makefile	Tue Feb 19 02:27:50 2002
@@ -11,14 +11,14 @@
 O_TARGET := idedriver.o
 
 export-objs		:= ide-taskfile.o ide.o ide-features.o ide-probe.o ataraid.o
-list-multi		:= ide-mod.o ide-probe-mod.o
+list-multi		:= ide-mod.o
 
 obj-y		:=
 obj-m		:=
 ide-obj-y	:=
 
 obj-$(CONFIG_BLK_DEV_HD)	+= hd.o
-obj-$(CONFIG_BLK_DEV_IDE)       += ide-mod.o ide-probe-mod.o
+obj-$(CONFIG_BLK_DEV_IDE)       += ide-mod.o
 obj-$(CONFIG_BLK_DEV_IDECS)     += ide-cs.o
 obj-$(CONFIG_BLK_DEV_IDEDISK)   += ide-disk.o
 obj-$(CONFIG_BLK_DEV_IDECD)     += ide-cd.o
@@ -76,13 +76,9 @@
 
 ide-obj-$(CONFIG_PROC_FS)		+= ide-proc.o
 
-ide-mod-objs		:= ide-taskfile.o ide.o ide-features.o $(ide-obj-y)
-ide-probe-mod-objs	:= ide-probe.o ide-geometry.o
+ide-mod-objs		:= ide-taskfile.o ide.o ide-probe.o ide-geometry.o ide-features.o $(ide-obj-y)
 
 include $(TOPDIR)/Rules.make
 
 ide-mod.o: $(ide-mod-objs)
 	$(LD) -r -o $@ $(ide-mod-objs)
-
-ide-probe-mod.o: $(ide-probe-mod-objs)
-	$(LD) -r -o $@ $(ide-probe-mod-objs)
diff -ur linux-2.5.4/drivers/ide/ide-cd.c linux/drivers/ide/ide-cd.c
--- linux-2.5.4/drivers/ide/ide-cd.c	Fri Feb 15 06:35:50 2002
+++ linux/drivers/ide/ide-cd.c	Tue Feb 19 03:11:03 2002
@@ -2906,6 +2906,7 @@
 	return 0;
 }
 
+int ide_cdrom_init(void);
 int ide_cdrom_reinit (ide_drive_t *drive);
 
 static ide_driver_t ide_cdrom_driver = {
@@ -2928,17 +2929,10 @@
 	capacity:		ide_cdrom_capacity,
 	special:		NULL,
 	proc:			NULL,
+	driver_init:		ide_cdrom_init,
 	driver_reinit:		ide_cdrom_reinit,
 };
 
-int ide_cdrom_init(void);
-static ide_module_t ide_cdrom_module = {
-	IDE_DRIVER_MODULE,
-	ide_cdrom_init,
-	&ide_cdrom_driver,
-	NULL
-};
-
 /* options */
 char *ignore = NULL;
 
@@ -2956,7 +2950,7 @@
 		printk ("%s: Can't allocate a cdrom structure\n", drive->name);
 		return 1;
 	}
-	if (ide_register_subdriver (drive, &ide_cdrom_driver, IDE_SUBDRIVER_VERSION)) {
+	if (ide_register_subdriver (drive, &ide_cdrom_driver)) {
 		printk ("%s: Failed to register the driver with ide.c\n", drive->name);
 		kfree (info);
 		return 1;
@@ -2973,7 +2967,7 @@
 	DRIVER(drive)->busy--;
 	failed--;
 
-	ide_register_module(&ide_cdrom_module);
+	ide_register_module(&ide_cdrom_driver);
 	MOD_DEC_USE_COUNT;
 	return 0;
 }
@@ -2988,7 +2982,7 @@
 			printk ("%s: cleanup_module() called while still busy\n", drive->name);
 			failed++;
 		}
-	ide_unregister_module (&ide_cdrom_module);
+	ide_unregister_module (&ide_cdrom_driver);
 }
  
 int ide_cdrom_init(void)
@@ -3015,7 +3009,7 @@
 			printk ("%s: Can't allocate a cdrom structure\n", drive->name);
 			continue;
 		}
-		if (ide_register_subdriver (drive, &ide_cdrom_driver, IDE_SUBDRIVER_VERSION)) {
+		if (ide_register_subdriver (drive, &ide_cdrom_driver)) {
 			printk ("%s: Failed to register the driver with ide.c\n", drive->name);
 			kfree (info);
 			continue;
@@ -3032,7 +3026,7 @@
 		DRIVER(drive)->busy--;
 		failed--;
 	}
-	ide_register_module(&ide_cdrom_module);
+	ide_register_module(&ide_cdrom_driver);
 	MOD_DEC_USE_COUNT;
 	return 0;
 }
diff -ur linux-2.5.4/drivers/ide/ide-disk.c linux/drivers/ide/ide-disk.c
--- linux-2.5.4/drivers/ide/ide-disk.c	Fri Feb 15 06:23:11 2002
+++ linux/drivers/ide/ide-disk.c	Tue Feb 19 03:07:32 2002
@@ -1030,6 +1030,7 @@
 	return ide_unregister_subdriver(drive);
 }
 
+int idedisk_init (void);
 int idedisk_reinit(ide_drive_t *drive);
 
 /*
@@ -1055,17 +1056,10 @@
 	capacity:		idedisk_capacity,
 	special:		idedisk_special,
 	proc:			idedisk_proc,
+	driver_init:		idedisk_init,
 	driver_reinit:		idedisk_reinit,
 };
 
-int idedisk_init (void);
-static ide_module_t idedisk_module = {
-	IDE_DRIVER_MODULE,
-	idedisk_init,
-	&idedisk_driver,
-	NULL
-};
-
 MODULE_DESCRIPTION("ATA DISK Driver");
 
 int idedisk_reinit (ide_drive_t *drive)
@@ -1074,7 +1068,7 @@
 
 	MOD_INC_USE_COUNT;
 
-	if (ide_register_subdriver (drive, &idedisk_driver, IDE_SUBDRIVER_VERSION)) {
+	if (ide_register_subdriver (drive, &idedisk_driver)) {
 		printk (KERN_ERR "ide-disk: %s: Failed to register the driver with ide.c\n", drive->name);
 		return 1;
 	}
@@ -1089,7 +1083,7 @@
 	DRIVER(drive)->busy--;
 	failed--;
 
-	ide_register_module(&idedisk_module);
+	ide_register_module(&idedisk_driver);
 	MOD_DEC_USE_COUNT;
 	return 0;
 }
@@ -1111,7 +1105,7 @@
 			ide_remove_proc_entries(drive->proc, idedisk_proc);
 #endif
 	}
-	ide_unregister_module(&idedisk_module);
+	ide_unregister_module(&idedisk_driver);
 }
 
 int idedisk_init (void)
@@ -1121,7 +1115,7 @@
 	
 	MOD_INC_USE_COUNT;
 	while ((drive = ide_scan_devices (ide_disk, idedisk_driver.name, NULL, failed++)) != NULL) {
-		if (ide_register_subdriver (drive, &idedisk_driver, IDE_SUBDRIVER_VERSION)) {
+		if (ide_register_subdriver (drive, &idedisk_driver)) {
 			printk (KERN_ERR "ide-disk: %s: Failed to register the driver with ide.c\n", drive->name);
 			continue;
 		}
@@ -1136,7 +1130,7 @@
 		DRIVER(drive)->busy--;
 		failed--;
 	}
-	ide_register_module(&idedisk_module);
+	ide_register_module(&idedisk_driver);
 	MOD_DEC_USE_COUNT;
 	return 0;
 }
diff -ur linux-2.5.4/drivers/ide/ide-floppy.c linux/drivers/ide/ide-floppy.c
--- linux-2.5.4/drivers/ide/ide-floppy.c	Fri Feb 15 06:47:11 2002
+++ linux/drivers/ide/ide-floppy.c	Tue Feb 19 03:14:55 2002
@@ -2046,6 +2046,7 @@
 
 #endif	/* CONFIG_PROC_FS */
 
+int idefloppy_init(void);
 int idefloppy_reinit(ide_drive_t *drive);
 
 /*
@@ -2071,17 +2072,10 @@
 	capacity:		idefloppy_capacity,
 	special:		NULL,
 	proc:			idefloppy_proc,
+	driver_init:		idefloppy_init,
 	driver_reinit:		idefloppy_reinit,
 };
 
-int idefloppy_init (void);
-static ide_module_t idefloppy_module = {
-	IDE_DRIVER_MODULE,
-	idefloppy_init,
-	&idefloppy_driver,
-	NULL
-};
-
 int idefloppy_reinit (ide_drive_t *drive)
 {
 	idefloppy_floppy_t *floppy;
@@ -2101,7 +2095,7 @@
 			printk (KERN_ERR "ide-floppy: %s: Can't allocate a floppy structure\n", drive->name);
 			continue;
 		}
-		if (ide_register_subdriver (drive, &idefloppy_driver, IDE_SUBDRIVER_VERSION)) {
+		if (ide_register_subdriver (drive, &idefloppy_driver)) {
 			printk (KERN_ERR "ide-floppy: %s: Failed to register the driver with ide.c\n", drive->name);
 			kfree (floppy);
 			continue;
@@ -2111,7 +2105,7 @@
 		DRIVER(drive)->busy--;
 		failed--;
 	}
-	ide_register_module(&idefloppy_module);
+	ide_register_module(&idefloppy_driver);
 	MOD_DEC_USE_COUNT;
 	return 0;
 }
@@ -2136,7 +2130,7 @@
 			ide_remove_proc_entries(drive->proc, idefloppy_proc);
 #endif
 	}
-	ide_unregister_module(&idefloppy_module);
+	ide_unregister_module(&idefloppy_driver);
 }
 
 /*
@@ -2163,7 +2157,7 @@
 			printk (KERN_ERR "ide-floppy: %s: Can't allocate a floppy structure\n", drive->name);
 			continue;
 		}
-		if (ide_register_subdriver (drive, &idefloppy_driver, IDE_SUBDRIVER_VERSION)) {
+		if (ide_register_subdriver (drive, &idefloppy_driver)) {
 			printk (KERN_ERR "ide-floppy: %s: Failed to register the driver with ide.c\n", drive->name);
 			kfree (floppy);
 			continue;
@@ -2173,7 +2167,7 @@
 		DRIVER(drive)->busy--;
 		failed--;
 	}
-	ide_register_module(&idefloppy_module);
+	ide_register_module(&idefloppy_driver);
 	MOD_DEC_USE_COUNT;
 	return 0;
 }
diff -ur linux-2.5.4/drivers/ide/ide-probe.c linux/drivers/ide/ide-probe.c
--- linux-2.5.4/drivers/ide/ide-probe.c	Mon Feb 18 01:46:29 2002
+++ linux/drivers/ide/ide-probe.c	Tue Feb 19 02:34:37 2002
@@ -927,19 +927,11 @@
 	return hwif->present;
 }
 
-int ideprobe_init (void);
-static ide_module_t ideprobe_module = {
-	IDE_PROBE_MODULE,
-	ideprobe_init,
-	NULL
-};
-
 int ideprobe_init (void)
 {
 	unsigned int index;
 	int probe[MAX_HWIFS];
 	
-	MOD_INC_USE_COUNT;
 	memset(probe, 0, MAX_HWIFS * sizeof(int));
 	for (index = 0; index < MAX_HWIFS; ++index)
 		probe[index] = !ide_hwifs[index].present;
@@ -953,31 +945,5 @@
 	for (index = 0; index < MAX_HWIFS; ++index)
 		if (probe[index])
 			hwif_init(&ide_hwifs[index]);
-	if (!ide_probe)
-		ide_probe = &ideprobe_module;
-	MOD_DEC_USE_COUNT;
-	return 0;
-}
-
-#ifdef MODULE
-extern int (*ide_xlate_1024_hook)(kdev_t, int, int, const char *);
-
-int init_module (void)
-{
-	unsigned int index;
-	
-	for (index = 0; index < MAX_HWIFS; ++index)
-		ide_unregister(index);
-	ideprobe_init();
-	create_proc_ide_interfaces();
-	ide_xlate_1024_hook = ide_xlate_1024;
 	return 0;
 }
-
-void cleanup_module (void)
-{
-	ide_probe = NULL;
-	ide_xlate_1024_hook = 0;
-}
-MODULE_LICENSE("GPL");
-#endif /* MODULE */
diff -ur linux-2.5.4/drivers/ide/ide-proc.c linux/drivers/ide/ide-proc.c
--- linux-2.5.4/drivers/ide/ide-proc.c	Sun Feb 17 03:43:38 2002
+++ linux/drivers/ide/ide-proc.c	Tue Feb 19 02:59:27 2002
@@ -378,14 +378,10 @@
 {
 	char		*out = page;
 	int		len;
-	ide_module_t	*p = ide_modules;
-	ide_driver_t	*driver;
+	struct ide_driver_s * driver;
 
-	while (p) {
-		driver = (ide_driver_t *) p->info;
-		if (driver)
-			out += sprintf(out, "%s\n",driver->name);
-		p = p->next;
+	for (driver = ide_drivers; driver; driver = driver->next) {
+		out += sprintf(out, "%s\n",driver->name);
 	}
 	len = out - page;
 	PROC_IDE_READ_RETURN(page,start,off,count,eof,len);
diff -ur linux-2.5.4/drivers/ide/ide-tape.c linux/drivers/ide/ide-tape.c
--- linux-2.5.4/drivers/ide/ide-tape.c	Fri Feb 15 06:33:15 2002
+++ linux/drivers/ide/ide-tape.c	Tue Feb 19 03:12:58 2002
@@ -6137,6 +6137,7 @@
 
 #endif
 
+int idetape_init (void);
 int idetape_reinit(ide_drive_t *drive);
 
 /*
@@ -6161,17 +6162,10 @@
 	pre_reset:		idetape_pre_reset,
 	capacity:		NULL,
 	proc:			idetape_proc,
+	driver_init:		idetape_init,
 	driver_reinit:		idetape_reinit,
 };
 
-int idetape_init (void);
-static ide_module_t idetape_module = {
-	IDE_DRIVER_MODULE,
-	idetape_init,
-	&idetape_driver,
-	NULL
-};
-
 /*
  *	Our character device supporting functions, passed to register_chrdev.
  */
@@ -6233,7 +6227,7 @@
 			printk (KERN_ERR "ide-tape: %s: Can't allocate a tape structure\n", drive->name);
 			continue;
 		}
-		if (ide_register_subdriver (drive, &idetape_driver, IDE_SUBDRIVER_VERSION)) {
+		if (ide_register_subdriver (drive, &idetape_driver)) {
 			printk (KERN_ERR "ide-tape: %s: Failed to register the driver with ide.c\n", drive->name);
 			kfree (tape);
 			continue;
@@ -6283,7 +6277,7 @@
 		if (drive != NULL && idetape_cleanup (drive))
 		printk (KERN_ERR "ide-tape: %s: cleanup_module() called while still busy\n", drive->name);
 	}
-	ide_unregister_module(&idetape_module);
+	ide_unregister_module(&idetape_driver);
 }
 
 /*
@@ -6304,7 +6298,7 @@
 			idetape_chrdevs[minor].drive = NULL;
 
 	if ((drive = ide_scan_devices (ide_tape, idetape_driver.name, NULL, failed++)) == NULL) {
-		ide_register_module (&idetape_module);
+		ide_register_module (&idetape_driver);
 		MOD_DEC_USE_COUNT;
 #if ONSTREAM_DEBUG
 		printk(KERN_INFO "ide-tape: MOD_DEC_USE_COUNT in idetape_init\n");
@@ -6338,7 +6332,7 @@
 			printk (KERN_ERR "ide-tape: %s: Can't allocate a tape structure\n", drive->name);
 			continue;
 		}
-		if (ide_register_subdriver (drive, &idetape_driver, IDE_SUBDRIVER_VERSION)) {
+		if (ide_register_subdriver (drive, &idetape_driver)) {
 			printk (KERN_ERR "ide-tape: %s: Failed to register the driver with ide.c\n", drive->name);
 			kfree (tape);
 			continue;
@@ -6363,7 +6357,7 @@
 		devfs_unregister_chrdev (IDETAPE_MAJOR, "ht");
 	} else
 		idetape_chrdev_present = 1;
-	ide_register_module (&idetape_module);
+	ide_register_module (&idetape_driver);
 	MOD_DEC_USE_COUNT;
 #if ONSTREAM_DEBUG
 	printk(KERN_INFO "ide-tape: MOD_DEC_USE_COUNT in idetape_init\n");
diff -ur linux-2.5.4/drivers/ide/ide.c linux/drivers/ide/ide.c
--- linux-2.5.4/drivers/ide/ide.c	Mon Feb 18 01:48:31 2002
+++ linux/drivers/ide/ide.c	Tue Feb 19 02:57:06 2002
@@ -196,10 +196,9 @@
 int noautodma = 0;
 
 /*
- * ide_modules keeps track of the available IDE chipset/probe/driver modules.
+ * This is the anchor of the single linked list of ide device type drivers.
  */
-ide_module_t *ide_modules;
-ide_module_t *ide_probe;
+struct ide_driver_s *ide_drivers;
 
 /*
  * This is declared extern in ide.h, for access by other IDE modules:
@@ -1864,30 +1863,23 @@
 
 static 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->init();
-	}
+	ideprobe_init();
 	revalidate_drives();
 }
 
 static void ide_driver_module (void)
 {
 	int index;
-	ide_module_t *module = ide_modules;
+	struct ide_driver_s *d;
 
 	for (index = 0; index < MAX_HWIFS; ++index)
 		if (ide_hwifs[index].present)
 			goto search;
 	ide_probe_module();
 search:
-	while (module) {
-		(void) module->init();
-		module = module->next;
-	}
+	for (d = ide_drivers; d != NULL; d = d->next)
+		d->driver_init();
+
 	revalidate_drives();
 }
 
@@ -3528,13 +3520,13 @@
 	return NULL;
 }
 
-int ide_register_subdriver (ide_drive_t *drive, ide_driver_t *driver, int version)
+int ide_register_subdriver (ide_drive_t *drive, ide_driver_t *driver)
 {
 	unsigned long flags;
 
 	save_flags(flags);		/* all CPUs */
 	cli();				/* all CPUs */
-	if (version != IDE_SUBDRIVER_VERSION || !drive->present || drive->driver != NULL || drive->busy || drive->usage) {
+	if (!drive->present || drive->driver != NULL || drive->busy || drive->usage) {
 		restore_flags(flags);	/* all CPUs */
 		return 1;
 	}
@@ -3618,26 +3610,26 @@
 	return 0;
 }
 
-int ide_register_module (ide_module_t *module)
+int ide_register_module (struct ide_driver_s *d)
 {
-	ide_module_t *p = ide_modules;
+	struct ide_driver_s *p = ide_drivers;
 
 	while (p) {
-		if (p == module)
+		if (p == d)
 			return 1;
 		p = p->next;
 	}
-	module->next = ide_modules;
-	ide_modules = module;
+	d->next = ide_drivers;
+	ide_drivers = d;
 	revalidate_drives();
 	return 0;
 }
 
-void ide_unregister_module (ide_module_t *module)
+void ide_unregister_module (struct ide_driver_s *d)
 {
-	ide_module_t **p;
+	struct ide_driver_s **p;
 
-	for (p = &ide_modules; (*p) && (*p) != module; p = &((*p)->next));
+	for (p = &ide_drivers; (*p) && (*p) != d; p = &((*p)->next));
 	if (*p)
 		*p = (*p)->next;
 }
@@ -3662,7 +3654,6 @@
 devfs_handle_t ide_devfs_handle;
 
 EXPORT_SYMBOL(ide_lock);
-EXPORT_SYMBOL(ide_probe);
 EXPORT_SYMBOL(drive_is_flashcard);
 EXPORT_SYMBOL(ide_timer_expiry);
 EXPORT_SYMBOL(ide_intr);
diff -ur linux-2.5.4/drivers/scsi/ide-scsi.c linux/drivers/scsi/ide-scsi.c
--- linux-2.5.4/drivers/scsi/ide-scsi.c	Fri Feb 15 06:43:18 2002
+++ linux/drivers/scsi/ide-scsi.c	Tue Feb 19 03:16:52 2002
@@ -535,6 +535,7 @@
 	return 0;
 }
 
+int idescsi_init(void);
 int idescsi_reinit(ide_drive_t *drive);
 
 /*
@@ -560,17 +561,10 @@
 	capacity:		NULL,
 	special:		NULL,
 	proc:			NULL,
+	driver_init:		idescsi_init,
 	driver_reinit:		idescsi_reinit,
 };
 
-int idescsi_init (void);
-static ide_module_t idescsi_module = {
-	IDE_DRIVER_MODULE,
-	idescsi_init,
-	&idescsi_driver,
-	NULL
-};
-
 int idescsi_reinit (ide_drive_t *drive)
 {
 #if 0
@@ -592,7 +586,7 @@
 				printk (KERN_ERR "ide-scsi: %s: Can't allocate a scsi structure\n", drive->name);
 				continue;
 			}
-			if (ide_register_subdriver (drive, &idescsi_driver, IDE_SUBDRIVER_VERSION)) {
+			if (ide_register_subdriver (drive, &idescsi_driver)) {
 				printk (KERN_ERR "ide-scsi: %s: Failed to register the driver with ide.c\n", drive->name);
 				kfree (scsi);
 				continue;
@@ -632,7 +626,7 @@
 				printk (KERN_ERR "ide-scsi: %s: Can't allocate a scsi structure\n", drive->name);
 				continue;
 			}
-			if (ide_register_subdriver (drive, &idescsi_driver, IDE_SUBDRIVER_VERSION)) {
+			if (ide_register_subdriver (drive, &idescsi_driver)) {
 				printk (KERN_ERR "ide-scsi: %s: Failed to register the driver with ide.c\n", drive->name);
 				kfree (scsi);
 				continue;
@@ -642,7 +636,7 @@
 			failed--;
 		}
 	}
-	ide_register_module(&idescsi_module);
+	ide_register_module(&idescsi_driver);
 	MOD_DEC_USE_COUNT;
 	return 0;
 }
@@ -912,7 +906,7 @@
 				failed++;
 			}
 	}
-	ide_unregister_module(&idescsi_module);
+	ide_unregister_module(&idescsi_driver);
 }
 
 module_init(init_idescsi_module);
diff -ur linux-2.5.4/include/linux/ide.h linux/include/linux/ide.h
--- linux-2.5.4/include/linux/ide.h	Mon Feb 18 02:04:57 2002
+++ linux/include/linux/ide.h	Tue Feb 19 03:02:28 2002
@@ -99,8 +99,8 @@
 #undef REALLY_FAST_IO
 #endif
 
-#define HWIF(drive)		((ide_hwif_t *)((drive)->hwif))
-#define HWGROUP(drive)		((ide_hwgroup_t *)(HWIF(drive)->hwgroup))
+#define HWIF(drive)		((drive)->hwif)
+#define HWGROUP(drive)		(HWIF(drive)->hwgroup)
 
 /*
  * Definitions for accessing IDE controller registers
@@ -371,7 +371,7 @@
 
 typedef struct ide_drive_s {
 	request_queue_t		 queue;	/* request queue */
-	struct ide_drive_s 	*next;	/* circular list of hwgroup drives */
+	struct ide_drive_s	*next;	/* circular list of hwgroup drives */
 	unsigned long sleep;		/* sleep until this time */
 	unsigned long service_start;	/* time we started last request */
 	unsigned long service_time;	/* service time of last request */
@@ -531,7 +531,7 @@
 
 typedef struct hwif_s {
 	struct hwif_s	*next;		/* for linked-list in ide_hwgroup_t */
-	void		*hwgroup;	/* actually (ide_hwgroup_t *) */
+	struct hwgroup_s *hwgroup;	/* actually (ide_hwgroup_t *) */
 	ide_ioreg_t	io_ports[IDE_NR_PORTS];	/* task file registers */
 	hw_regs_t	hw;		/* Hardware info */
 	ide_drive_t	drives[MAX_DRIVES];	/* drive info */
@@ -702,10 +702,6 @@
 /*
  * Subdrivers support.
  */
-#define IDE_SUBDRIVER_VERSION	1
-
-typedef void		(ide_setting_proc)(ide_drive_t *);
-
 typedef struct ide_driver_s {
 	const char			*name;
 	byte				media;
@@ -726,25 +722,15 @@
 	unsigned long (*capacity)(ide_drive_t *);
 	ide_startstop_t	(*special)(ide_drive_t *);
 	ide_proc_entry_t		*proc;
+	int (*driver_init)(void);
 	int (*driver_reinit)(ide_drive_t *);
-} ide_driver_t;
-
-#define DRIVER(drive)		((ide_driver_t *)((drive)->driver))
-
-/*
- * IDE modules.
- */
-#define IDE_CHIPSET_MODULE		0	/* not supported yet */
-#define IDE_PROBE_MODULE		1
-#define IDE_DRIVER_MODULE		2
 
+	/* FIXME: Single linked list of drivers for iteration.
+	 */
+	struct ide_driver_s *next;
+} ide_driver_t;
 
-typedef struct ide_module_s {
-	int type;
-	int (*init)(void);
-	void *info;
-	struct ide_module_s *next;
-} ide_module_t;
+#define DRIVER(drive)		((drive)->driver)
 
 /*
  * ide_hwifs[] is the master data structure used to keep track
@@ -755,9 +741,8 @@
  *
  */
 #ifndef _IDE_C
-extern	ide_hwif_t	ide_hwifs[];		/* master data repository */
-extern	ide_module_t	*ide_modules;
-extern	ide_module_t	*ide_probe;
+extern struct hwif_s ide_hwifs[];		/* master data repository */
+extern struct ide_driver_s *ide_drivers;
 #endif
 extern int noautodma;
 
@@ -1060,9 +1045,11 @@
 int ide_reinit_drive (ide_drive_t *drive);
 
 #ifdef _IDE_C
-#ifdef CONFIG_BLK_DEV_IDE
-int ideprobe_init (void);
-#endif /* CONFIG_BLK_DEV_IDE */
+# ifdef CONFIG_BLK_DEV_IDE
+/* Probe for devices attached to the systems host controllers.
+ */
+extern int ideprobe_init (void);
+# endif
 #ifdef CONFIG_BLK_DEV_IDEDISK
 int idedisk_reinit (ide_drive_t *drive);
 int idedisk_init (void);
@@ -1085,12 +1072,12 @@
 #endif /* CONFIG_BLK_DEV_IDESCSI */
 #endif /* _IDE_C */
 
-int ide_register_module (ide_module_t *module);
-void ide_unregister_module (ide_module_t *module);
+extern int ide_register_module (struct ide_driver_s *d);
+extern void ide_unregister_module (struct ide_driver_s *d);
 ide_drive_t *ide_scan_devices (byte media, const char *name, ide_driver_t *driver, int n);
-int ide_register_subdriver (ide_drive_t *drive, ide_driver_t *driver, int version);
-int ide_unregister_subdriver (ide_drive_t *drive);
-int ide_replace_subdriver(ide_drive_t *drive, const char *driver);
+extern int ide_register_subdriver(ide_drive_t *drive, ide_driver_t *driver);
+extern int ide_unregister_subdriver(ide_drive_t *drive);
+extern int ide_replace_subdriver(ide_drive_t *drive, const char *driver);
 
 #ifdef CONFIG_BLK_DEV_IDEPCI
 #define ON_BOARD		1

  parent reply	other threads:[~2002-02-19 11:47 UTC|newest]

Thread overview: 217+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-13 22:38 linux-2.5.5-pre1 Linus Torvalds
2002-02-13 23:16 ` linux-2.5.5-pre1 Matthias Andree
2002-02-14  2:30   ` linux-2.5.5-pre1 Jeff Garzik
2002-02-14  1:17 ` linux-2.5.5-pre1 Daniel Phillips
2002-02-14  1:35   ` linux-2.5.5-pre1 -= M.J. Prinsen =-
2002-02-14  9:22     ` linux-2.5.5-pre1 Allan Sandfeld
2002-02-14  5:31   ` linux-2.5.5-pre1 Linus Torvalds
2002-02-14  8:04 ` linux-2.5.5-pre1 bert hubert
2002-02-14 16:23   ` linux-2.5.5-pre1 Linus Torvalds
2002-02-14 16:53     ` linux-2.5.5-pre1 Thomas Capricelli
2002-02-14 14:08 ` [PATCH} 2.5.5-pre1 VESA fb Martin Dalecki
2002-02-14 15:16   ` Alan Cox
2002-02-14 15:32     ` Martin Dalecki
2002-02-14 20:49 ` Compile error with linux-2.5.5-pre1 & advansys scsi Gerold J. Wucherpfennig
2002-02-19 11:37 ` [PATCH] 2.5.5-pre1 IDE cleanup Martin Dalecki
2002-02-19 11:46 ` Martin Dalecki [this message]
2002-02-22 10:07   ` [PATCH] 2.5.5-pre1 IDE cleanup 9 Gerd Knorr
2002-02-22 13:50     ` Martin Dalecki
2002-02-22 10:42   ` Gadi Oxman
2002-02-22 13:45     ` Martin Dalecki
2002-02-22 14:03       ` Vojtech Pavlik
2002-02-22 14:12         ` Jeff Garzik
2002-02-22 14:20           ` Martin Dalecki
2002-02-22 14:16         ` Martin Dalecki
2002-02-22 14:38           ` Vojtech Pavlik
2002-02-22 14:46             ` Jeff Garzik
2002-02-22 14:47             ` Martin Dalecki
2002-02-22 14:58           ` Jeff Garzik
2002-02-22 15:01           ` Jeff Garzik
2002-02-22 15:12             ` Martin Dalecki
2002-02-23  8:05           ` Keith Owens
2002-02-23 14:55             ` Martin Dalecki
2002-02-22 14:16         ` Arjan van de Ven
2002-02-22 14:40           ` Vojtech Pavlik
2002-02-21 20:31             ` Gérard Roudier
2002-02-22 19:56               ` Jeff Garzik
2002-02-21 21:14                 ` Gérard Roudier
2002-02-22 22:35                   ` Jeff Garzik
2002-02-22 21:34               ` Vojtech Pavlik
2002-02-22 21:45                 ` Greg KH
2002-02-22 21:56                 ` Jeff Garzik
2002-02-22 21:59                   ` Vojtech Pavlik
2002-02-22 23:06                 ` Martin Dalecki
2002-02-22 14:45             ` Jeff Garzik
2002-02-21 20:39               ` Gérard Roudier
2002-02-22 19:47                 ` Jeff Garzik
2002-02-21 21:01                   ` Gérard Roudier
2002-02-22 20:07                     ` Greg KH
2002-02-21 21:24                       ` Gérard Roudier
2002-02-22 20:41                         ` Greg KH
2002-02-22 21:30                           ` Erik Andersen
2002-02-22 21:42                             ` Greg KH
2002-02-22 21:54                               ` Erik Andersen
2002-02-22 21:22                         ` Erik Andersen
2002-02-21 23:17                           ` Gérard Roudier
2002-02-22 22:23                             ` Erik Andersen
2002-02-22 23:27                         ` Rik van Riel
2002-02-22 20:09                       ` Andre Hedrick
2002-02-22 20:29                         ` Greg KH
2002-02-22 20:34                           ` Andre Hedrick
2002-02-22 23:46                             ` Vojtech Pavlik
2002-02-22 20:32                         ` arjan
2002-02-22 23:44                         ` Vojtech Pavlik
2002-02-23 15:35                           ` [PATCH] 2.5.5 IDE cleanup 12 Martin Dalecki
2002-02-22 23:59                         ` [PATCH] 2.5.5-pre1 IDE cleanup 9 Jeff Garzik
2002-02-22 19:46                   ` Andre Hedrick
2002-02-22 20:06                     ` Jeff Garzik
2002-02-22 20:19                       ` Andre Hedrick
2002-02-22 21:47                         ` Vojtech Pavlik
2002-02-22 23:02                         ` Martin Dalecki
2002-02-22 23:46                         ` Jeff Garzik
2002-02-23 14:53                           ` Martin Dalecki
2002-02-22 21:40                     ` Vojtech Pavlik
2002-02-22 21:36                 ` Vojtech Pavlik
2002-02-20 10:49 ` [PATCH] 2.5.5-pre1 IDE cleanup 10 Martin Dalecki
2002-02-21  9:39   ` [PATCH] 2.5.5 IDE cleanup 11 Martin Dalecki
2002-02-21 10:53     ` Jeff Garzik
2002-02-21 11:06       ` Andre Hedrick
2002-02-21 17:27       ` Martin Dalecki
2002-02-21 17:52         ` Alan Cox
2002-02-21 17:57           ` Martin Dalecki
2002-02-21 18:14             ` Alan Cox
2002-02-21 18:44               ` Martin Dalecki
2002-02-22 15:51               ` Pavel Machek
2002-02-21 13:59     ` Alan Cox
2002-02-21 17:32       ` Martin Dalecki
2002-02-21 17:50         ` Alan Cox
2002-02-21 18:17           ` Martin Dalecki
2002-02-21 21:24       ` Andre Hedrick
2002-02-21 21:30         ` Andre Hedrick
2002-02-22  9:25           ` Flash Back -- kernel 2.1.111 Andre Hedrick
2002-02-22 10:08             ` Rik van Riel
2002-02-22 10:09               ` Jens Axboe
2002-02-22 17:06               ` Linus Torvalds
2002-02-22 18:58                 ` Andre Hedrick
2002-02-23 17:56                   ` Linus Torvalds
2002-02-24  4:42                     ` Andre Hedrick
2002-02-24  5:38                       ` Andre Hedrick
2002-02-24  6:01                         ` Linus Torvalds
2002-02-24  7:30                           ` Troy Benjegerdes
2002-02-24 12:18                             ` Martin Dalecki
2002-02-24 20:29                               ` Troy Benjegerdes
2002-02-24 20:32                                 ` Martin Dalecki
2002-02-24 21:15                                   ` Alan Cox
2002-02-24 21:11                                     ` Martin Dalecki
2002-02-24 21:31                                       ` Alan Cox
2002-02-24 21:19                                         ` Martin Dalecki
2002-02-24 21:25                                         ` nick
2002-02-24 21:32                                           ` Rik van Riel
2002-02-24 21:42                                             ` Vojtech Pavlik
2002-02-24 21:47                                               ` nick
2002-02-24 21:41                                         ` Vojtech Pavlik
2002-02-24 21:47                                           ` Rik van Riel
2002-02-24 21:31                                     ` Jeff Garzik
2002-02-24 21:40                                     ` Vojtech Pavlik
2002-02-24 21:46                                       ` Jeff Garzik
2002-02-24 21:50                                         ` Vojtech Pavlik
2002-02-24 22:18                                   ` David S. Miller
2002-02-24 20:54                                 ` Vojtech Pavlik
2002-02-24 21:19                                   ` Troy Benjegerdes
2002-02-24 21:37                                     ` Vojtech Pavlik
2002-02-24 22:03                                     ` Paul Mackerras
2002-02-24 22:08                                       ` Vojtech Pavlik
2002-02-24 23:08                                         ` Chris Wedgwood
2002-02-24 22:23                                       ` Paul Mackerras
2002-02-24 22:37                                         ` Troy Benjegerdes
2002-02-24 22:01                                 ` Paul Mackerras
2002-02-24 22:10                                   ` Vojtech Pavlik
2002-02-24 23:10                                     ` Chris Wedgwood
2002-02-24 22:25                                   ` Paul Mackerras
2002-02-24 22:27                                     ` Andre Hedrick
2002-02-24 22:48                                       ` Vojtech Pavlik
2002-02-25  8:49                                       ` Martin Dalecki
2002-02-24 22:39                                     ` Vojtech Pavlik
2002-02-24 23:12                                       ` Chris Wedgwood
2002-02-24 22:44                                     ` David S. Miller
2002-02-24 22:51                                       ` Vojtech Pavlik
2002-02-24 22:59                                         ` Troy Benjegerdes
2002-02-24 23:02                                           ` Vojtech Pavlik
2002-02-24 23:26                                           ` Paul Mackerras
2002-02-27 15:59                                             ` Remco Post
2002-02-24 23:01                                   ` Alan Cox
2002-02-24 20:52                               ` Vojtech Pavlik
2002-02-24 23:04                             ` Chris Wedgwood
2002-02-24  9:27                           ` Andre Hedrick
2002-02-24 12:28                           ` [PATCH] IDE clean 12 3rd attempt Martin Dalecki
2002-02-24 16:14                             ` Greg KH
2002-03-08 15:46                           ` [PATCH] 2.5.6 IDE 18 Martin Dalecki
2002-03-08 16:42                           ` Richard Gooch
2002-03-09 12:56                             ` Martin Dalecki
2002-02-24 10:23                       ` Flash Back -- kernel 2.1.111 Vojtech Pavlik
2002-02-24 12:14                       ` Martin Dalecki
2002-03-11 12:40                 ` [PATCH] 2.5.6 IDE 19 Martin Dalecki
2002-03-11 15:19                   ` Alan Cox
2002-03-11 16:23                     ` Martin Dalecki
2002-03-11 16:58                       ` Alan Cox
2002-03-11 17:03                         ` Martin Dalecki
2002-03-11 17:10                           ` Charles Cazabon
2002-03-11 17:30                           ` Alan Cox
2002-03-11 18:23                             ` Martin Dalecki
2002-03-11 19:41                               ` Alan Cox
2002-03-11 18:00                           ` Andre Hedrick
2002-03-11 19:03                             ` [PATCH] 2.5.6 IDE 19, return of taskfile Gunther Mayer
2002-03-11 19:14                               ` Andre Hedrick
2002-03-11 19:22                                 ` Gunther Mayer
2002-03-11 19:23                               ` Martin Dalecki
2002-03-12  9:52                                 ` Zwane Mwaikambo
2002-03-11 19:47                               ` Alan Cox
2002-03-11 19:38                                 ` Alexander Viro
2002-03-11 19:42                                   ` Andre Hedrick
2002-03-11 19:55                                     ` Alexander Viro
2002-03-11 20:02                                   ` Alan Cox
2002-03-13 12:55                                     ` Pavel Machek
2002-03-15 17:49                                       ` john slee
2002-03-16  2:26                                         ` Erik Andersen
2002-03-11 19:39                                 ` Andre Hedrick
2002-03-12  1:48                           ` [PATCH] 2.5.6 IDE 19 Pavel Machek
2002-03-11 21:50                         ` Barry K. Nathan
2002-03-12  1:44                         ` Pavel Machek
2002-03-11 17:42                       ` Andre Hedrick
2002-03-11 18:06                         ` Wayne Whitney
2002-03-11 18:08                         ` Alan Cox
2002-03-11 18:05                           ` Anton Altaparmakov
2002-03-11 19:39                             ` Alan Cox
2002-03-11 22:02                               ` Vojtech Pavlik
2002-03-11 22:01                             ` Vojtech Pavlik
2002-03-12  8:58                               ` Joachim Breuer
2002-03-11 22:06                             ` Anton Altaparmakov
2002-03-11 18:27                           ` Andre Hedrick
2002-03-11 18:51                             ` Martin Dalecki
2002-03-11 19:02                               ` Andre Hedrick
2002-03-11 19:12                                 ` Martin Dalecki
2002-03-11 19:24                                   ` Andre Hedrick
2002-03-11 19:30                                     ` Martin Dalecki
2002-03-11 19:35                                       ` Andre Hedrick
2002-03-11 19:51                                         ` Davide Libenzi
2002-03-11 19:51                                           ` Andre Hedrick
2002-03-11 21:19                                           ` Rik van Riel
2002-03-11 22:44                                             ` Davide Libenzi
2002-03-13 19:19                                               ` David Ford
2002-03-12  0:00                                             ` Jos Hulzink
2002-03-12  5:17                                             ` Andre Hedrick
2002-03-11 19:27                                   ` Russell King
2002-03-11 22:10                           ` Anton Altaparmakov
2002-03-11 17:53                       ` Arjan van de Ven
2002-03-11 19:04                         ` Martin Dalecki
2002-03-11 21:02                         ` Rik van Riel
2002-03-11 22:44                           ` Alan Cox
2002-03-12  0:47                       ` Bill Davidsen
2002-03-12  0:28                     ` Pavel Machek
2002-03-13 14:14                 ` [PATCH] IDE 21 Martin Dalecki
2002-03-13 17:42                   ` Vojtech Pavlik
2002-02-22 10:12             ` Flash Back -- kernel 2.1.111 Pedro M. Rodrigues
2002-02-22 19:03               ` Andre Hedrick
2002-02-22 19:56                 ` Alan Cox
2002-02-22 19:38                   ` Andre Hedrick
2002-02-22 10:37           ` David S. Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3C723B15.2030409@evision-ventures.com \
    --to=dalecki@evision-ventures.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).