summaryrefslogtreecommitdiff
path: root/drivers/ata
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2006-09-19 00:42:13 -0400
committerJeff Garzik <jeff@garzik.org>2006-09-19 00:42:13 -0400
commit4a3381feb823e06c8e2da7e283c17b0b6fdbddcf (patch)
treee1bef4c3db854bb10fd13dc67415d77b5d999533 /drivers/ata
parentfea63e38013ec628ab3f7fddc4c2148064b7910a (diff)
parent47a5c6fa0e204a2b63309c648bb2fde36836c826 (diff)
Merge branch 'master' into upstream
Diffstat (limited to 'drivers/ata')
-rw-r--r--drivers/ata/libata-core.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index bb66a12c84e5..e85c2f8cf193 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -1276,10 +1276,15 @@ int ata_dev_read_id(struct ata_device *dev, unsigned int *p_class,
swap_buf_le16(id, ATA_ID_WORDS);
/* sanity check */
- if ((class == ATA_DEV_ATA) != (ata_id_is_ata(id) | ata_id_is_cfa(id))) {
- rc = -EINVAL;
- reason = "device reports illegal type";
- goto err_out;
+ rc = -EINVAL;
+ reason = "device reports illegal type";
+
+ if (class == ATA_DEV_ATA) {
+ if (!ata_id_is_ata(id) && !ata_id_is_cfa(id))
+ goto err_out;
+ } else {
+ if (ata_id_is_ata(id))
+ goto err_out;
}
if (post_reset && class == ATA_DEV_ATA) {