]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
PCI: Use pci_release_resource() instead of release_resource()
authorIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Fri, 29 Aug 2025 13:10:57 +0000 (16:10 +0300)
committerBjorn Helgaas <bhelgaas@google.com>
Tue, 16 Sep 2025 16:19:10 +0000 (11:19 -0500)
commit3baeae36039afc233d4a42d6ff4aa7019892619f
tree456bbcbd0630c49a68eb8049fd90b4cddf11d3cd
parentb15f45ab65e2ce04339fbd54387a9209529d315b
PCI: Use pci_release_resource() instead of release_resource()

A few places in setup-bus.c call release_resource() directly and end up
duplicating functionality from pci_release_resource() such as parent check,
logging, and clearing the resource. Worse yet, the way the resource is
cleared is inconsistent between different sites.

Convert release_resource() calls into pci_release_resource() to remove code
duplication. This will also make the resource start, end, and flags
behavior consistent, i.e., start address is cleared, and only
IORESOURCE_UNSET is asserted for the resource.

While at it, eliminate the unnecessary initialization of idx variable in
pci_bridge_release_resources().

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Link: https://patch.msgid.link/20250829131113.36754-9-ilpo.jarvinen@linux.intel.com
drivers/pci/setup-bus.c
drivers/pci/setup-res.c
include/linux/pci.h