Commit 12e2e17d authored by Yahu Gao's avatar Yahu Gao Committed by Damien Le Moal
Browse files

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: default avatarYahu Gao <gaoyh12@lenovo.com>
Signed-off-by: default avatarDamien Le Moal <dlemoal@kernel.org>
parent a7eb54d4
Loading
Loading
Loading
Loading
+1 −5
Original line number Original line Diff line number Diff line
@@ -3802,11 +3802,7 @@ int ata_dev_revalidate(struct ata_device *dev, unsigned int new_class,
		return -ENODEV;
		return -ENODEV;


	/* fail early if !ATA && !ATAPI to avoid issuing [P]IDENTIFY to PMP */
	/* fail early if !ATA && !ATAPI to avoid issuing [P]IDENTIFY to PMP */
	if (ata_class_enabled(new_class) &&
	if (ata_class_enabled(new_class) && new_class == ATA_DEV_PMP) {
	    new_class != ATA_DEV_ATA &&
	    new_class != ATA_DEV_ATAPI &&
	    new_class != ATA_DEV_ZAC &&
	    new_class != ATA_DEV_SEMB) {
		ata_dev_info(dev, "class mismatch %u != %u\n",
		ata_dev_info(dev, "class mismatch %u != %u\n",
			     dev->class, new_class);
			     dev->class, new_class);
		rc = -ENODEV;
		rc = -ENODEV;