]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
PCI/sysfs: Add static PCI resource attribute macros
authorKrzysztof Wilczyński <kwilczynski@kernel.org>
Fri, 8 May 2026 04:35:25 +0000 (04:35 +0000)
committerBjorn Helgaas <bhelgaas@google.com>
Fri, 8 May 2026 22:58:35 +0000 (17:58 -0500)
commitb15ac7e008bf0039f981da21e983b2df130152ff
tree079c0aae1abf23dd4cd2a4fef3de1658d253d375
parent25ec7f57deceec633f27bc93b615f951e2ade814
PCI/sysfs: Add static PCI resource attribute macros

Add three macros for declaring static binary attributes for PCI resource
files:

  - pci_dev_resource_io_attr(), for I/O BAR resources (read/write)
  - pci_dev_resource_uc_attr(), for memory BAR resources (mmap uncached)
  - pci_dev_resource_wc_attr(), for write-combine resources (mmap WC)

Each macro only sets the callbacks its resource type needs.  The I/O macro
conditionally includes mmap support via __PCI_RESOURCE_IO_MMAP_ATTRS on
architectures where arch_can_pci_mmap_io() is true at compile time (such as
PowerPC, SPARC, and Xtensa).

Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Tested-by: Shivaprasad G Bhat <sbhat@linux.ibm.com>
Link: https://patch.msgid.link/20260508043543.217179-7-kwilczynski@kernel.org
drivers/pci/pci-sysfs.c