PCI/VPD: Remove struct pci_vpd_ops
authorHeiner Kallweit <hkallweit1@gmail.com>
Sun, 8 Aug 2021 17:20:05 +0000 (19:20 +0200)
committerBjorn Helgaas <bhelgaas@google.com>
Thu, 12 Aug 2021 17:48:32 +0000 (12:48 -0500)
commita38fccdb6289d9e4796e746040b491bb0f31b151
tree3cb068cf9cf70716b51bc5c2d00219fe2a79910d
parentd27f7344ba89897d0ce6ebe0c9eecbe214f9bb8f
PCI/VPD: Remove struct pci_vpd_ops

Some multi-function devices share VPD hardware across functions and don't
work correctly for concurrent VPD accesses to different functions.

Struct pci_vpd_ops was added by 932c435caba8 ("PCI: Add dev_flags bit to
access VPD through function 0") so that on these devices, VPD accesses to
any function would always go to function 0.

It's easier to just check for the PCI_DEV_FLAGS_VPD_REF_F0 quirk bit in the
two places we need it than to deal with the struct pci_vpd_ops.

Simplify the code by removing struct pci_vpd_ops and removing the indirect
calls.

[bhelgaas: check for !func0_dev earlier, commit log]
Link: https://lore.kernel.org/r/b2532a41-df8b-860f-461f-d5c066c819d0@gmail.com
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/vpd.c