linux-stable/drivers/pci
Krzysztof Wilczyński d93f839905 PCI/sysfs: Convert "vpd" to static attribute
The "vpd" sysfs attribute allows access to Vital Product Data (VPD).
Previously it was dynamically created either by pci_bus_add_device() or the
pci_sysfs_init() initcall, but since it doesn't need to be created or
removed dynamically, we can use a static attribute so the device model
takes care of addition and removal automatically.

Convert "vpd" to a static attribute and use the .is_bin_visible() callback
to check whether the device supports VPD.

Remove pcie_vpd_create_sysfs_dev_files(),
pcie_vpd_remove_sysfs_dev_files(), pci_create_capabilities_sysfs(), and
pci_create_capabilities_sysfs(), which are no longer needed.

[bhelgaas: This is substantially the same as the earlier patch from Heiner
Kallweit <hkallweit1@gmail.com>.  I included Krzysztof's change here so all
the "convert to static attribute" changes are together.]

[bhelgaas: rename to vpd_read()/vpd_write() and pci_dev_vpd_attr_group]
Suggested-by: Oliver O'Halloran <oohall@gmail.com>
Based-on: https://lore.kernel.org/r/7703024f-8882-9eec-a122-599871728a89@gmail.com
Based-on-patch-by: Heiner Kallweit <hkallweit1@gmail.com>
Link: https://lore.kernel.org/r/20210416205856.3234481-5-kw@linux.com
Signed-off-by: Krzysztof Wilczyński <kw@linux.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2021-04-29 10:07:31 -05:00
..
controller pci-v5.12-changes 2021-02-25 09:56:08 -08:00
endpoint PCI: endpoint: Add EP function driver to provide NTB functionality 2021-02-23 14:12:28 -06:00
hotplug PCI: acpiphp: Remove unused acpiphp_callback typedef 2021-02-18 17:32:37 -06:00
pcie pci-v5.12-changes 2021-02-25 09:56:08 -08:00
switch PCI: switchtec: Add missing __iomem tag to fix sparse warnings 2020-07-31 11:23:45 -05:00
access.c Merge branch 'pci/misc' 2020-08-05 18:24:16 -05:00
ats.c Merge branch 'pci/doc' 2020-08-05 18:24:22 -05:00
bus.c PCI: Add device even if driver attach failed 2020-07-07 17:33:41 -05:00
ecam.c PCI: Unify ECAM constants in native PCI Express drivers 2020-12-10 14:55:49 -06:00
host-bridge.c
iov.c PCI/IOV: Mark VFs as not implementing PCI_COMMAND_MEMORY 2020-09-21 14:42:11 -06:00
irq.c PCI: Remove unused pci_lost_interrupt() 2020-07-29 14:25:18 -05:00
Kconfig pci-v5.10-changes 2020-10-22 12:41:00 -07:00
Makefile PCI: Apply CONFIG_PCI_DEBUG to entire drivers/pci hierarchy 2021-02-09 15:10:20 -06:00
mmap.c
msi.c PCI/MSI: Set device flag indicating only 32-bit MSI support 2020-12-04 12:17:04 -06:00
of.c PCI: of: Warn if non-prefetchable memory aperture size is > 32-bit 2020-11-18 16:16:38 +00:00
p2pdma.c RDMA 5.11 pull request 2020-12-16 13:42:26 -08:00
pci-acpi.c pci-v5.11-changes 2020-12-15 16:49:59 -08:00
pci-bridge-emul.c PCI: pci-bridge-emul: Fix array overruns, improve safety 2021-02-17 17:25:31 -06:00
pci-bridge-emul.h
pci-driver.c Merge branch 'pci/misc' 2020-12-15 15:11:08 -06:00
pci-label.c PCI: Replace http:// links with https:// 2020-06-30 13:05:09 -05:00
pci-mid.c
pci-pf-stub.c PCI/IOV: Simplify pci-pf-stub with module_pci_driver() 2020-09-17 12:40:20 -05:00
pci-stub.c
pci-sysfs.c PCI/sysfs: Convert "vpd" to static attribute 2021-04-29 10:07:31 -05:00
pci.c pci-v5.12-changes 2021-02-25 09:56:08 -08:00
pci.h PCI/sysfs: Convert "vpd" to static attribute 2021-04-29 10:07:31 -05:00
probe.c Merge branch 'pci/msi' 2020-12-15 15:11:08 -06:00
proc.c PCI: Revoke mappings like devmem 2021-02-11 15:59:19 +01:00
quirks.c Merge branch 'remotes/lorenzo/pci/dwc' 2020-12-15 15:11:11 -06:00
remove.c PCI/sysfs: Convert "reset" to static attribute 2021-04-27 17:53:20 -05:00
rom.c
search.c PCI: Remove WARN_ON(in_interrupt()) 2021-02-10 16:46:29 -06:00
setup-bus.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
setup-irq.c
setup-res.c PCI: Decline to resize resources if boot config must be preserved 2021-01-12 16:39:52 -06:00
slot.c Merge branch 'pci/misc' 2020-12-15 15:11:08 -06:00
syscall.c PCI: Align checking of syscall user config accessors 2021-01-27 10:41:59 -06:00
vc.c PCI: Fix kerneldoc warnings 2020-08-05 18:23:14 -05:00
vpd.c PCI/sysfs: Convert "vpd" to static attribute 2021-04-29 10:07:31 -05:00
xen-pcifront.c dma-mapping: split <linux/dma-mapping.h> 2020-10-06 07:07:03 +02:00