ata: libata-core: Simplify if condition in ata_dev_revalidate()

Simplify the condition used in ata_dev_revalidate() to not
issue identify commands to port multiplier devices.

Signed-off-by: Yahu Gao <gaoyh12@lenovo.com>
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
This commit is contained in:
Yahu Gao 2023-05-15 10:36:58 +08:00 committed by Damien Le Moal
parent a7eb54d440
commit 12e2e17de2
1 changed files with 1 additions and 5 deletions

View File

@ -3802,11 +3802,7 @@ int ata_dev_revalidate(struct ata_device *dev, unsigned int new_class,
return -ENODEV;
/* fail early if !ATA && !ATAPI to avoid issuing [P]IDENTIFY to PMP */
if (ata_class_enabled(new_class) &&
new_class != ATA_DEV_ATA &&
new_class != ATA_DEV_ATAPI &&
new_class != ATA_DEV_ZAC &&
new_class != ATA_DEV_SEMB) {
if (ata_class_enabled(new_class) && new_class == ATA_DEV_PMP) {
ata_dev_info(dev, "class mismatch %u != %u\n",
dev->class, new_class);
rc = -ENODEV;