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

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

ide: add ->read_status method



* Remove ide_read_status() inline helper.

* Add ->read_status method for reading ATA Status register
  and use it instead of ->INB.

While at it:

* Don't use HWGROUP() macro.

There should be no functional changes caused by this patch.

Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
parent c6dfa867
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -375,12 +375,14 @@ static int icside_dma_test_irq(ide_drive_t *drive)

static void icside_dma_timeout(ide_drive_t *drive)
{
	ide_hwif_t *hwif = drive->hwif;

	printk(KERN_ERR "%s: DMA timeout occurred: ", drive->name);

	if (icside_dma_test_irq(drive))
		return;

	ide_dump_status(drive, "DMA timeout", ide_read_status(drive));
	ide_dump_status(drive, "DMA timeout", hwif->read_status(hwif));

	icside_dma_end(drive);
}
+1 −1
Original line number Diff line number Diff line
@@ -35,7 +35,7 @@ ide_startstop_t ide_pc_intr(ide_drive_t *drive, struct ide_atapi_pc *pc,
	}

	/* Clear the interrupt */
	stat = ide_read_status(drive);
	stat = hwif->read_status(hwif);

	if (pc->flags & PC_FLAG_DMA_IN_PROGRESS) {
		if (hwif->dma_ops->dma_end(drive) ||
+8 −4
Original line number Diff line number Diff line
@@ -280,11 +280,12 @@ static void ide_dump_status_no_sense(ide_drive_t *drive, const char *msg, u8 st)
 */
static int cdrom_decode_status(ide_drive_t *drive, int good_stat, int *stat_ret)
{
	struct request *rq = HWGROUP(drive)->rq;
	ide_hwif_t *hwif = drive->hwif;
	struct request *rq = hwif->hwgroup->rq;
	int stat, err, sense_key;

	/* check for errors */
	stat = ide_read_status(drive);
	stat = hwif->read_status(hwif);

	if (stat_ret)
		*stat_ret = stat;
@@ -606,6 +607,8 @@ static ide_startstop_t cdrom_transfer_packet_command(ide_drive_t *drive,
static int ide_cd_check_ireason(ide_drive_t *drive, struct request *rq,
				int len, int ireason, int rw)
{
	ide_hwif_t *hwif = drive->hwif;

	/*
	 * ireason == 0: the drive wants to receive data from us
	 * ireason == 2: the drive is expecting to transfer data to us
@@ -624,7 +627,7 @@ static int ide_cd_check_ireason(ide_drive_t *drive, struct request *rq,
		 * Some drives (ASUS) seem to tell us that status info is
		 * available.  Just get it and ignore.
		 */
		(void)ide_read_status(drive);
		(void)hwif->read_status(hwif);
		return 0;
	} else {
		/* drive wants a command packet, or invalid ireason... */
@@ -1199,8 +1202,9 @@ static ide_startstop_t ide_cd_do_request(ide_drive_t *drive, struct request *rq,

	if (blk_fs_request(rq)) {
		if (info->cd_flags & IDE_CD_FLAG_SEEKING) {
			ide_hwif_t *hwif = drive->hwif;
			unsigned long elapsed = jiffies - info->start_seek;
			int stat = ide_read_status(drive);
			int stat = hwif->read_status(hwif);

			if ((stat & SEEK_STAT) != SEEK_STAT) {
				if (elapsed < IDECD_SEEK_TIMEOUT) {
+3 −2
Original line number Diff line number Diff line
@@ -100,10 +100,11 @@ static const struct drive_list_entry drive_blacklist [] = {
 
ide_startstop_t ide_dma_intr (ide_drive_t *drive)
{
	ide_hwif_t *hwif = drive->hwif;
	u8 stat = 0, dma_stat = 0;

	dma_stat = drive->hwif->dma_ops->dma_end(drive);
	stat = ide_read_status(drive);
	dma_stat = hwif->dma_ops->dma_end(drive);
	stat = hwif->read_status(hwif);

	if (OK_STAT(stat,DRIVE_READY,drive->bad_wstat|DRQ_STAT)) {
		if (!dma_stat) {
+2 −1
Original line number Diff line number Diff line
@@ -949,11 +949,12 @@ static int idefloppy_get_format_progress(ide_drive_t *drive, int __user *arg)

		/* Else assume format_unit has finished, and we're at 0x10000 */
	} else {
		ide_hwif_t *hwif = drive->hwif;
		unsigned long flags;
		u8 stat;

		local_irq_save(flags);
		stat = ide_read_status(drive);
		stat = hwif->read_status(hwif);
		local_irq_restore(flags);

		progress_indication = ((stat & SEEK_STAT) == 0) ? 0 : 0x10000;
Loading