[PATCH 05/10] PCI: ixp4xx: Use generic PCI Conf Type 0 helper

From: Ilpo Järvinen
Date: Mon Apr 29 2024 - 06:48:04 EST


Convert Type 0 address calculation to use pci_conf0_offset() instead of
abusing PCI_CONF1_ADDRESS().

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@xxxxxxxxxxxxxxx>
---
drivers/pci/controller/pci-ixp4xx.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/controller/pci-ixp4xx.c b/drivers/pci/controller/pci-ixp4xx.c
index acb85e0d5675..44639838df9c 100644
--- a/drivers/pci/controller/pci-ixp4xx.c
+++ b/drivers/pci/controller/pci-ixp4xx.c
@@ -188,8 +188,8 @@ static u32 ixp4xx_config_addr(u8 bus_num, u16 devfn, int where)
/* Root bus is always 0 in this hardware */
if (bus_num == 0) {
/* type 0 */
- return (PCI_CONF1_ADDRESS(0, 0, PCI_FUNC(devfn), where) &
- ~PCI_CONF1_ENABLE) | BIT(32-PCI_SLOT(devfn));
+ return pci_conf0_addr(devfn, where) |
+ BIT(32 - PCI_SLOT(devfn));
} else {
/* type 1 */
return (PCI_CONF1_ADDRESS(bus_num, PCI_SLOT(devfn),
--
2.39.2