diff options
author | Tejun Heo <htejun@gmail.com> | 2008-04-07 12:25:35 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-04-17 15:44:25 -0400 |
commit | 2a0c15ca39f5881aa1b472ca856bb7a2e584ece7 (patch) | |
tree | 28fe9136db8016720c272ba39df3a3b43a9715e2 /drivers/ata/libata-eh.c | |
parent | e50e3ce5e70e36e6069a8cc8292df76058fa9e23 (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/libata-eh.c')
-rw-r--r-- | drivers/ata/libata-eh.c | 19 |
1 files changed, 1 insertions, 18 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 | ||
2066 | static int ata_eh_followup_srst_needed(struct ata_link *link, | 2064 | 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, | |||
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 |