PCI/sysfs: Add legacy I/O and memory attribute macros

Currently, the static binary attributes for the PCI legacy I/O port
and ISA memory space files (legacy_io, legacy_io_sparse, legacy_mem and
legacy_mem_sparse) are open-coded, with each definition repeating the
same set of properties and callbacks.

Add two macros for declaring such attributes:

  - pci_legacy_resource_io_attr(),  for legacy I/O port space (read/write)
  - pci_legacy_resource_mem_attr(), for legacy memory space (mmap)

Each macro takes the fixed attribute size as a parameter.

Then replace the open-coded definitions with the newly added macros.

No functional changes intended.

Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org>
[bhelgaas: shorten macros to fit in 80 columns]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Link: https://patch.msgid.link/20260721020427.1541197-4-kwilczynski@kernel.org
This commit is contained in:
Krzysztof Wilczyński 2026-07-21 02:04:26 +00:00 • committed by Bjorn Helgaas
commit 1b7c9855bb