patch-2.4.0-test3 linux/drivers/ide/ide.c

Next file: linux/drivers/ide/piix.c
Previous file: linux/drivers/ide/ide-probe.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test2/linux/drivers/ide/ide.c linux/drivers/ide/ide.c
@@ -2023,6 +2023,7 @@
 			drive->id = NULL;
 		}
 		drive->present = 0;
+		blk_cleanup_queue(&drive->queue);
 	}
 	if (d->present)
 		hwgroup->drive = d;
@@ -2048,7 +2049,6 @@
 	kfree(blksize_size[hwif->major]);
 	kfree(max_sectors[hwif->major]);
 	kfree(max_readahead[hwif->major]);
-	blk_cleanup_queue(BLK_DEFAULT_QUEUE(hwif->major));
 	blk_dev[hwif->major].data = NULL;
 	blk_dev[hwif->major].queue = NULL;
 	blksize_size[hwif->major] = NULL;
@@ -2858,6 +2858,18 @@
 	const char max_drive = 'a' + ((MAX_HWIFS * MAX_DRIVES) - 1);
 	const char max_hwif  = '0' + (MAX_HWIFS - 1);
 
+	
+	if (strncmp(s,"hd",2) == 0 && s[2] == '=')	/* hd= is for hd.c   */
+		return 0;				/* driver and not us */
+
+	if (strncmp(s,"ide",3) &&
+	    strncmp(s,"idebus",6) &&
+#ifdef CONFIG_BLK_DEV_VIA82CXXX
+	    strncmp(s,"splitfifo",9) &&
+#endif /* CONFIG_BLK_DEV_VIA82CXXX */
+	    strncmp(s,"hd",2))		/* hdx= & hdxlun= */
+		return 0;
+
 	printk("ide_setup: %s", s);
 	init_ide_data ();
 
@@ -2867,7 +2879,7 @@
 
 		printk(" : Enabled support for IDE doublers\n");
 		ide_doubler = 1;
-		return 0;
+		return 1;
 	}
 #endif /* CONFIG_BLK_DEV_IDEDOUBLER */
 
@@ -2875,7 +2887,7 @@
 	if (!strcmp(s, "ide=reverse")) {
 		ide_scan_direction = 1;
 		printk(" : Enabled support for IDE inverse scan order.\n");
-		return 0;
+		return 1;
 	}
 #endif /* CONFIG_BLK_DEV_IDEPCI */
 
@@ -3188,17 +3200,17 @@
 			case 0: goto bad_option;
 			default:
 				printk(" -- SUPPORT NOT CONFIGURED IN THIS KERNEL\n");
-				return 0;
+				return 1;
 		}
 	}
 bad_option:
 	printk(" -- BAD OPTION\n");
-	return 0;
+	return 1;
 bad_hwif:
 	printk("-- NOT SUPPORTED ON ide%d", hw);
 done:
 	printk("\n");
-	return 0;
+	return 1;
 }
 
 /*
@@ -3594,7 +3606,7 @@
 
 	if (!banner_printed) {
 		printk(KERN_INFO "Uniform Multi-Platform E-IDE driver " REVISION "\n");
-		ide_devfs_handle = devfs_mk_dir (NULL, "ide", 3, NULL);
+		ide_devfs_handle = devfs_mk_dir (NULL, "ide", NULL);
 		system_bus_speed = ide_system_bus_speed();
 		banner_printed = 1;
 	}
@@ -3614,6 +3626,10 @@
 	return 0;
 }
 
+#ifdef MODULE
+char *options = NULL;
+MODULE_PARM(options,"s");
+
 static void __init parse_options (char *line)
 {
 	char *next = line;
@@ -3623,21 +3639,11 @@
 	while ((line = next) != NULL) {
  		if ((next = strchr(line,' ')) != NULL)
 			*next++ = 0;
-		if (!strncmp(line,"ide",3) ||
-		    !strncmp(line,"idebus",6) ||
-#ifdef CONFIG_BLK_DEV_VIA82CXXX
-		    !strncmp(line,"splitfifo",9) ||
-#endif /* CONFIG_BLK_DEV_VIA82CXXX */
-		    !strncmp(line,"hdxlun",6) ||
-		    (!strncmp(line,"hd",2) && line[2] != '='))
-			(void) ide_setup(line);
+		if (!ide_setup(line))
+			printk ("Unknown option '%s'\n", line);
 	}
 }
 
-#ifdef MODULE
-char *options = NULL;
-MODULE_PARM(options,"s");
-
 int init_module (void)
 {
 	parse_options(options);
@@ -3664,12 +3670,6 @@
 
 #else /* !MODULE */
 
-static int parse_ide_setup (char *line)
-{
-	parse_options(line);
-	/* We MUST return 0 as otherwise no subsequent __setup option works... */
-	return 0;
-}
-__setup("", parse_ide_setup);
+__setup("", ide_setup);
 
 #endif /* MODULE */

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)