aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2008-04-07 12:25:35 -0400
committerJeff Garzik <jgarzik@redhat.com>2008-04-17 15:44:25 -0400
commit2a0c15ca39f5881aa1b472ca856bb7a2e584ece7 (patch)
tree28fe9136db8016720c272ba39df3a3b43a9715e2 /drivers/ata
parente50e3ce5e70e36e6069a8cc8292df76058fa9e23 (diff)
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: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/ata')
-rw-r--r--drivers/ata/libata-eh.c19
-rw-r--r--drivers/ata/sata_inic162x.c2
-rw-r--r--drivers/ata/sata_sil24.c3
3 files changed, 1 insertions, 23 deletions
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index 99f83bdc572b..88cdc4938bea 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -2052,15 +2052,13 @@ static int ata_do_reset(struct ata_link *link, ata_reset_fn_t reset,
2052 classes[dev->devno] = ATA_DEV_UNKNOWN; 2052 classes[dev->devno] = ATA_DEV_UNKNOWN;
2053 2053
2054 rc = reset(link, classes, deadline); 2054 rc = reset(link, classes, deadline);
2055 if (rc)
2056 return rc;
2057 2055
2058 /* convert all ATA_DEV_UNKNOWN to ATA_DEV_NONE */ 2056 /* convert all ATA_DEV_UNKNOWN to ATA_DEV_NONE */
2059 ata_link_for_each_dev(dev, link) 2057 ata_link_for_each_dev(dev, link)
2060 if (classes[dev->devno] == ATA_DEV_UNKNOWN) 2058 if (classes[dev->devno] == ATA_DEV_UNKNOWN)
2061 classes[dev->devno] = ATA_DEV_NONE; 2059 classes[dev->devno] = ATA_DEV_NONE;
2062 2060
2063 return 0; 2061 return rc;
2064} 2062}
2065 2063
2066static int ata_eh_followup_srst_needed(struct ata_link *link, 2064static int ata_eh_followup_srst_needed(struct ata_link *link,
@@ -2209,21 +2207,6 @@ int ata_eh_reset(struct ata_link *link, int classify,
2209 if (rc && rc != -EAGAIN) 2207 if (rc && rc != -EAGAIN)
2210 goto fail; 2208 goto fail;
2211 2209
2212 /* was classification successful? */
2213 if (classify && classes[0] == ATA_DEV_UNKNOWN &&
2214 !(lflags & ATA_LFLAG_ASSUME_CLASS)) {
2215 if (try < max_tries) {
2216 ata_link_printk(link, KERN_WARNING,
2217 "classification failed\n");
2218 rc = -EINVAL;
2219 goto fail;
2220 }
2221
2222 ata_link_printk(link, KERN_WARNING,
2223 "classfication failed, assuming ATA\n");
2224 lflags |= ATA_LFLAG_ASSUME_ATA;
2225 }
2226
2227 done: 2210 done:
2228 ata_link_for_each_dev(dev, link) { 2211 ata_link_for_each_dev(dev, link) {
2229 /* After the reset, the device state is PIO 0 and the 2212 /* After the reset, the device state is PIO 0 and the
diff --git a/drivers/ata/sata_inic162x.c b/drivers/ata/sata_inic162x.c
index 9f47d0022453..d27bb9a2568f 100644
--- a/drivers/ata/sata_inic162x.c
+++ b/drivers/ata/sata_inic162x.c
@@ -428,8 +428,6 @@ static int inic_hardreset(struct ata_link *link, unsigned int *class,
428 428
429 ata_sff_tf_read(ap, &tf); 429 ata_sff_tf_read(ap, &tf);
430 *class = ata_dev_classify(&tf); 430 *class = ata_dev_classify(&tf);
431 if (*class == ATA_DEV_UNKNOWN)
432 *class = ATA_DEV_NONE;
433 } 431 }
434 432
435 return 0; 433 return 0;
diff --git a/drivers/ata/sata_sil24.c b/drivers/ata/sata_sil24.c
index 068789361895..20757fa6115d 100644
--- a/drivers/ata/sata_sil24.c
+++ b/drivers/ata/sata_sil24.c
@@ -693,9 +693,6 @@ static int sil24_softreset(struct ata_link *link, unsigned int *class,
693 sil24_read_tf(ap, 0, &tf); 693 sil24_read_tf(ap, 0, &tf);
694 *class = ata_dev_classify(&tf); 694 *class = ata_dev_classify(&tf);
695 695
696 if (*class == ATA_DEV_UNKNOWN)
697 *class = ATA_DEV_NONE;
698
699 out: 696 out:
700 DPRINTK("EXIT, class=%u\n", *class); 697 DPRINTK("EXIT, class=%u\n", *class);
701 return 0; 698 return 0;