PCI/VPD: Treat invalid VPD like missing VPD capability
authorHeiner Kallweit <hkallweit1@gmail.com>
Sun, 8 Aug 2021 17:23:57 +0000 (19:23 +0200)
committerBjorn Helgaas <bhelgaas@google.com>
Thu, 12 Aug 2021 17:48:51 +0000 (12:48 -0500)
commitfe7568cf2f2dc3a0783f6ffdb3802c1ce2085466
treedf6dfd8b6a3591a78a1756465be14f44eb81db0f
parent7bac54497c3e3b2ca37b7043f1fa78586540f10e
PCI/VPD: Treat invalid VPD like missing VPD capability

Exporting sysfs files that can't be accessed doesn't make much sense.
Therefore, if either a quirk or the dynamic size calculation result in VPD
being marked as invalid, treat this as though the device has no VPD
capability.  One consequence is that the "vpd" sysfs file is not visible.

Link: https://lore.kernel.org/r/6a02b204-4ed2-4553-c3b2-eacf9554fa8d@gmail.com
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/vpd.c