summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libata-core.c
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2006-09-17 01:05:43 -0400
committerJeff Garzik <jeff@garzik.org>2006-09-17 01:05:43 -0400
commit803db244b9f71102e366fd689000c1417b9a7508 (patch)
tree2fe1abfd16cded8074905b6b91d9d1943e15325e /drivers/scsi/libata-core.c
parent8b98a37c4b00f3fbcf162281bd4595777e61241b (diff)
parentf04b92e97d21b1921c91ec1d6d5e8bbf8606b77a (diff)
Merge branch 'master' into upstream-fixes
Diffstat (limited to 'drivers/scsi/libata-core.c')
-rw-r--r--drivers/scsi/libata-core.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
index 73dd6c8deed..427b73a3886 100644
--- a/drivers/scsi/libata-core.c
+++ b/drivers/scsi/libata-core.c
@@ -1256,10 +1256,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) {