patch-2.3.40 linux/drivers/i2o/i2o_block.c

Next file: linux/drivers/i2o/i2o_core.c
Previous file: linux/drivers/fc4/Makefile
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.39/linux/drivers/i2o/i2o_block.c linux/drivers/i2o/i2o_block.c
@@ -738,7 +738,9 @@
 	if (minor >= MAX_I2OB<<4)
 		return -ENODEV;
 	dev=&i2ob_dev[(minor&0xF0)];
-
+	if(dev->i2odev == NULL)
+		return -ENODEV;
+		
 	if(dev->refcnt++==0)
 	{ 
 		u32 msg[6];
@@ -821,7 +823,6 @@
 	i2ob_query_device(dev, 0x0000, 6, &status, 4);
 	i2ob_sizes[unit] = (int)(size>>10);
 	i2ob_hardsizes[unit] = blocksize;
-	i2ob_gendisk.part[unit].nr_sects = i2ob_sizes[unit];
 
 	limit=4096;	/* 8 deep scatter gather */
 
@@ -869,7 +870,7 @@
 	printk(".\n");
 	printk("%s: Maximum sectors/read set to %d.\n", 
 		d->dev_name, i2ob_max_sectors[unit]);
-	resetup_one_dev(&i2ob_gendisk, unit>>4);
+	grok_partitions(&i2ob_gendisk, unit>>4, 1<<4, (long)(size>>9));
 	return 0;
 }
 
@@ -1013,14 +1014,6 @@
 	check_media_change:	i2ob_media_change,
 	revalidate:		i2ob_revalidate,
 };
-
-/*
- *	Partitioning
- */
- 
-static void i2ob_geninit(struct gendisk *gd)
-{
-}
 	
 static struct gendisk i2ob_gendisk = 
 {
@@ -1028,8 +1021,6 @@
 	"i2ohd",
 	4,
 	1<<4,
-	MAX_I2OB,
-	i2ob_geninit,
 	i2ob,
 	i2ob_sizes,
 	0,
@@ -1128,6 +1119,9 @@
 	 *	Finally see what is actually plugged in to our controllers
 	 */
 
+	for (i = 0; i < MAX_I2OB; i++)
+		register_disk(&i2ob_gendisk, MKDEV(MAJOR_NR,i<<4), 1<<4,
+			&i2ob_fops, 0);
 	i2ob_probe();
 	
 	register_reboot_notifier(&i2ob_reboot_notifier);

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