patch-2.3.25 linux/drivers/block/ide-geometry.c

Next file: linux/drivers/block/ide-proc.c
Previous file: linux/drivers/block/cpqarray.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.24/linux/drivers/block/ide-geometry.c linux/drivers/block/ide-geometry.c
@@ -81,7 +81,6 @@
  */
 static void
 ontrack(ide_drive_t *drive, int heads, int *c, int *h, int *s) {
-	struct hd_driveid *id = drive->id;
 	static const byte dm_head_vals[] = {4, 8, 16, 32, 64, 128, 255, 0};
 	const byte *headp = dm_head_vals;
 	unsigned long total, tracks;
@@ -92,10 +91,7 @@
 	 * 1024*255*63. Now take S=63, H the first in the sequence
 	 * 4, 8, 16, 32, 64, 128, 255 such that 63*H*1024 >= total.
 	 */
-	if (id)
-		total = id->cyls * id->heads * id->sectors;
-	else
-		total = drive->cyl * drive->head * drive->sect;
+	total = DRIVER(drive)->capacity(drive);
 
 	*s = 63;
 

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