Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit def860d0 authored by Borislav Petkov's avatar Borislav Petkov Committed by Bartlomiej Zolnierkiewicz
Browse files

ide-atapi: assign expiry and timeout based on device type



There should be no functionality change resulting from this patch.

Signed-off-by: default avatarBorislav Petkov <petkovbb@gmail.com>
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
parent 8c662852
Loading
Loading
Loading
Loading
+17 −13
Original line number Diff line number Diff line
@@ -525,13 +525,16 @@ static ide_startstop_t ide_transfer_pc(ide_drive_t *drive)
		cmd_len = COMMAND_SIZE(rq->cmd[0]);
		if (cmd_len < ATAPI_MIN_CDB_BYTES)
			cmd_len = ATAPI_MIN_CDB_BYTES;
	} else

		timeout = rq->timeout;
		expiry  = ide_cd_expiry;
	} else {
		cmd_len = ATAPI_MIN_CDB_BYTES;

		/*
		 * If necessary schedule the packet transfer to occur 'timeout'
	 * miliseconds later in ide_delayed_transfer_pc() after the device
	 * says it's ready for a packet.
		 * miliseconds later in ide_delayed_transfer_pc() after the
		 * device says it's ready for a packet.
		 */
		if (drive->atapi_flags & IDE_AFLAG_ZIP_DRIVE) {
			timeout = drive->pc_delay;
@@ -541,6 +544,7 @@ static ide_startstop_t ide_transfer_pc(ide_drive_t *drive)
							       : WAIT_TAPE_CMD;
			expiry = NULL;
		}
	}

	/* Set the interrupt routine */
	ide_set_handler(drive, ide_pc_intr, timeout, expiry);