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

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

diff -u --recursive --new-file v2.4.0-test2/linux/drivers/ide/ide-cd.c linux/drivers/ide/ide-cd.c
@@ -1768,6 +1768,9 @@
 	if (stat)
 		toc->capacity = 0x1fffff;
 
+	HWIF(drive)->gd->sizes[drive->select.b.unit << PARTN_BITS] = (toc->capacity * SECTORS_PER_FRAME) >> (BLOCK_SIZE_BITS - 9);
+	drive->part[0].nr_sects = toc->capacity * SECTORS_PER_FRAME;
+
 	/* Remember that we've read this stuff. */
 	CDROM_STATE_FLAGS (drive)->toc_valid = 1;
 
@@ -2066,11 +2069,11 @@
 	struct request_sense sense;
 	int ret;
 
-	toc = info->toc;
-	if (!CDROM_STATE_FLAGS(drive)->toc_valid || toc == NULL)
+	if (!CDROM_STATE_FLAGS(drive)->toc_valid || info->toc == NULL)
 		if ((ret = cdrom_read_toc(drive, &sense)))
 			return ret;
 
+	toc = info->toc;
 	ms_info->addr.lba = toc->last_session_lba;
 	ms_info->xa_flag = toc->xa_flag;
 
@@ -2614,11 +2617,10 @@
 /* options */
 char *ignore = NULL;
 
-#ifdef MODULE
 MODULE_PARM(ignore, "s");
 MODULE_DESCRIPTION("ATAPI CD-ROM Driver");
 
-void __exit ide_cdrom_exit(void)
+static void __exit ide_cdrom_exit(void)
 {
 	ide_drive_t *drive;
 	int failed = 0;
@@ -2630,7 +2632,6 @@
 		}
 	ide_unregister_module (&ide_cdrom_module);
 }
-#endif /* MODULE */
  
 int ide_cdrom_init(void)
 {

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