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

Commit 2a0c15ca authored by Tejun Heo's avatar Tejun Heo Committed by Jeff Garzik
Browse files

libata: kill dead code paths in reset path



Some code paths which had been made obsolete by recent reset
simplification were still around.  Kill them.

* ata_eh_reset() checked for ATA_DEV_UNKNOWN to determine
  classification failure.  This is no longer applicable.

* ata_do_reset() should convert ATA_DEV_UNKNOWN to ATA_DEV_NONE
  regardless of reset result (e.g. -EAGAIN).

* LLDs don't need to convert ATA_DEV_UNKNOWN to ATA_DEV_NONE.

Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
parent e50e3ce5
Loading
Loading
Loading
Loading
+1 −18
Original line number Original line Diff line number Diff line
@@ -2052,15 +2052,13 @@ static int ata_do_reset(struct ata_link *link, ata_reset_fn_t reset,
		classes[dev->devno] = ATA_DEV_UNKNOWN;
		classes[dev->devno] = ATA_DEV_UNKNOWN;


	rc = reset(link, classes, deadline);
	rc = reset(link, classes, deadline);
	if (rc)
		return rc;


	/* convert all ATA_DEV_UNKNOWN to ATA_DEV_NONE */
	/* convert all ATA_DEV_UNKNOWN to ATA_DEV_NONE */
	ata_link_for_each_dev(dev, link)
	ata_link_for_each_dev(dev, link)
		if (classes[dev->devno] == ATA_DEV_UNKNOWN)
		if (classes[dev->devno] == ATA_DEV_UNKNOWN)
			classes[dev->devno] = ATA_DEV_NONE;
			classes[dev->devno] = ATA_DEV_NONE;


	return 0;
	return rc;
}
}


static int ata_eh_followup_srst_needed(struct ata_link *link,
static int ata_eh_followup_srst_needed(struct ata_link *link,
@@ -2209,21 +2207,6 @@ int ata_eh_reset(struct ata_link *link, int classify,
	if (rc && rc != -EAGAIN)
	if (rc && rc != -EAGAIN)
		goto fail;
		goto fail;


	/* was classification successful? */
	if (classify && classes[0] == ATA_DEV_UNKNOWN &&
	    !(lflags & ATA_LFLAG_ASSUME_CLASS)) {
		if (try < max_tries) {
			ata_link_printk(link, KERN_WARNING,
					"classification failed\n");
			rc = -EINVAL;
			goto fail;
		}

		ata_link_printk(link, KERN_WARNING,
				"classfication failed, assuming ATA\n");
		lflags |= ATA_LFLAG_ASSUME_ATA;
	}

 done:
 done:
	ata_link_for_each_dev(dev, link) {
	ata_link_for_each_dev(dev, link) {
		/* After the reset, the device state is PIO 0 and the
		/* After the reset, the device state is PIO 0 and the
+0 −2
Original line number Original line Diff line number Diff line
@@ -428,8 +428,6 @@ static int inic_hardreset(struct ata_link *link, unsigned int *class,


		ata_sff_tf_read(ap, &tf);
		ata_sff_tf_read(ap, &tf);
		*class = ata_dev_classify(&tf);
		*class = ata_dev_classify(&tf);
		if (*class == ATA_DEV_UNKNOWN)
			*class = ATA_DEV_NONE;
	}
	}


	return 0;
	return 0;
+0 −3
Original line number Original line Diff line number Diff line
@@ -693,9 +693,6 @@ static int sil24_softreset(struct ata_link *link, unsigned int *class,
	sil24_read_tf(ap, 0, &tf);
	sil24_read_tf(ap, 0, &tf);
	*class = ata_dev_classify(&tf);
	*class = ata_dev_classify(&tf);


	if (*class == ATA_DEV_UNKNOWN)
		*class = ATA_DEV_NONE;

 out:
 out:
	DPRINTK("EXIT, class=%u\n", *class);
	DPRINTK("EXIT, class=%u\n", *class);
	return 0;
	return 0;