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

Commit ff074883 authored by Bartlomiej Zolnierkiewicz's avatar Bartlomiej Zolnierkiewicz
Browse files

ide: remove drive->ctl



Remove drive->ctl (it is always equal to 0x08 after init time).

While at it:

* Use ATA_DEVCTL_OBS define.

There should be no functional changes caused by this patch.

Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
parent 0fd04dcc
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -96,7 +96,7 @@ static void h8300_tf_read(ide_drive_t *drive, ide_task_t *task)
	}

	/* be sure we're looking at the low order bits */
	outb(drive->ctl & ~0x80, io_ports->ctl_addr);
	outb(ATA_DEVCTL_OBS & ~0x80, io_ports->ctl_addr);

	if (task->tf_flags & IDE_TFLAG_IN_NSECT)
		tf->nsect  = inb(io_ports->nsect_addr);
@@ -110,7 +110,7 @@ static void h8300_tf_read(ide_drive_t *drive, ide_task_t *task)
		tf->device = inb(io_ports->device_addr);

	if (task->tf_flags & IDE_TFLAG_LBA48) {
		outb(drive->ctl | 0x80, io_ports->ctl_addr);
		outb(ATA_DEVCTL_OBS | 0x80, io_ports->ctl_addr);

		if (task->tf_flags & IDE_TFLAG_IN_HOB_FEATURE)
			tf->hob_feature = inb(io_ports->feature_addr);
+5 −5
Original line number Diff line number Diff line
@@ -186,7 +186,7 @@ static void ide_tf_read(ide_drive_t *drive, ide_task_t *task)
	}

	/* be sure we're looking at the low order bits */
	tf_outb(drive->ctl & ~0x80, io_ports->ctl_addr);
	tf_outb(ATA_DEVCTL_OBS & ~0x80, io_ports->ctl_addr);

	if (task->tf_flags & IDE_TFLAG_IN_NSECT)
		tf->nsect  = tf_inb(io_ports->nsect_addr);
@@ -200,7 +200,7 @@ static void ide_tf_read(ide_drive_t *drive, ide_task_t *task)
		tf->device = tf_inb(io_ports->device_addr);

	if (task->tf_flags & IDE_TFLAG_LBA48) {
		tf_outb(drive->ctl | 0x80, io_ports->ctl_addr);
		tf_outb(ATA_DEVCTL_OBS | 0x80, io_ports->ctl_addr);

		if (task->tf_flags & IDE_TFLAG_IN_HOB_FEATURE)
			tf->hob_feature = tf_inb(io_ports->feature_addr);
@@ -1125,13 +1125,13 @@ static ide_startstop_t do_reset1 (ide_drive_t *drive, int do_not_try_atapi)
	 * recover from reset very quickly, saving us the first 50ms wait time.
	 */
	/* set SRST and nIEN */
	hwif->OUTBSYNC(hwif, drive->ctl | 6, io_ports->ctl_addr);
	hwif->OUTBSYNC(hwif, ATA_DEVCTL_OBS | 6, io_ports->ctl_addr);
	/* more than enough time */
	udelay(10);
	if (drive->quirk_list == 2)
		ctl = drive->ctl;	/* clear SRST and nIEN */
		ctl = ATA_DEVCTL_OBS;		/* clear SRST and nIEN */
	else
		ctl = drive->ctl | 2;	/* clear SRST, leave nIEN */
		ctl = ATA_DEVCTL_OBS | 2;	/* clear SRST, leave nIEN */
	hwif->OUTBSYNC(hwif, ctl, io_ports->ctl_addr);
	/* more than enough time */
	udelay(10);
+1 −1
Original line number Diff line number Diff line
@@ -1065,7 +1065,7 @@ static int init_irq (ide_hwif_t *hwif)

		if (io_ports->ctl_addr)
			/* clear nIEN */
			hwif->OUTBSYNC(hwif, 0x08, io_ports->ctl_addr);
			hwif->OUTBSYNC(hwif, ATA_DEVCTL_OBS, io_ports->ctl_addr);

		if (request_irq(hwif->irq,&ide_intr,sa,hwif->name,hwgroup))
	       		goto out_unlink;
+0 −1
Original line number Diff line number Diff line
@@ -136,7 +136,6 @@ static void ide_port_init_devices_data(ide_hwif_t *hwif)
		drive->media			= ide_disk;
		drive->select.all		= (unit<<4)|0xa0;
		drive->hwif			= hwif;
		drive->ctl			= 0x08;
		drive->ready_stat		= READY_STAT;
		drive->bad_wstat		= BAD_W_STAT;
		drive->special.b.recalibrate	= 1;
+1 −2
Original line number Diff line number Diff line
@@ -759,8 +759,7 @@ static void hpt3xx_maskproc(ide_drive_t *drive, int mask)
				enable_irq (hwif->irq);
		}
	} else
		outb(mask ? (drive->ctl | 2) : (drive->ctl & ~2),
		     hwif->io_ports.ctl_addr);
		outb(ATA_DEVCTL_OBS | (mask ? 2 : 0), hwif->io_ports.ctl_addr);
}

/*
Loading