]> git.ipfire.org Git - thirdparty/linux.git/commit
alpha/PCI: Use BAR index in sysfs attr->private instead of resource pointer
authorKrzysztof Wilczyński <kwilczynski@kernel.org>
Fri, 8 May 2026 04:35:31 +0000 (04:35 +0000)
committerBjorn Helgaas <bhelgaas@google.com>
Tue, 23 Jun 2026 20:19:08 +0000 (15:19 -0500)
commit7d9779cb10265f34f405eff1eb50bb955d3f6e7d
treef979bc970abc4b6eb62371484e67546b0641309b
parent78a228f0aa0e9eba31955950c8a40a9945e2c8bb
alpha/PCI: Use BAR index in sysfs attr->private instead of resource pointer

Currently, Alpha's pci_create_one_attr() stores a resource pointer in
attr->private, and pci_mmap_resource() loops through all BARs to find
the matching index.

Store the BAR index directly in attr->private and retrieve the resource via
pci_resource_n().  This eliminates the loop and aligns with the convention
used by the generic PCI sysfs code.

The PCI core change was first added in the commit dca40b186b75 ("PCI: Use
BAR index in sysfs attr->private instead of resource pointer").

Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Tested-by: Magnus Lindholm <linmag7@gmail.com>
Tested-by: Shivaprasad G Bhat <sbhat@linux.ibm.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Acked-by: Magnus Lindholm <linmag7@gmail.com>
Link: https://patch.msgid.link/20260508043543.217179-13-kwilczynski@kernel.org
arch/alpha/kernel/pci-sysfs.c