ata: libata-core: Simplify if condition in ata_dev_revalidate()
authorYahu Gao <gaoyh12@lenovo.com>
Mon, 15 May 2023 02:36:58 +0000 (10:36 +0800)
committerDamien Le Moal <dlemoal@kernel.org>
Tue, 16 May 2023 11:08:05 +0000 (20:08 +0900)
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>
drivers/ata/libata-core.c

index e9fc69fbe06bc58bae54b65e0dea95f6ac115a87..8796ef51641cbec2abff0ed922d5b0e20f124624 100644 (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;