aboutsummaryrefslogtreecommitdiff
path: root/drivers/pci
diff options
context:
space:
mode:
authorGravatar Bjorn Helgaas <bhelgaas@google.com> 2023-04-20 16:16:36 -0500
committerGravatar Bjorn Helgaas <bhelgaas@google.com> 2023-04-20 16:16:36 -0500
commit73af737eea9e7ff5a99d10e709f7f1ad7c6abe36 (patch)
tree903f7fc015e88fafd8c7e30cba01db5fd56ea4e2 /drivers/pci
parentMerge branch 'pci/controller/dwc' (diff)
parentPCI: ixp4xx: Use PCI_CONF1_ADDRESS() macro (diff)
downloadlinux-73af737eea9e7ff5a99d10e709f7f1ad7c6abe36.tar.gz
linux-73af737eea9e7ff5a99d10e709f7f1ad7c6abe36.tar.bz2
linux-73af737eea9e7ff5a99d10e709f7f1ad7c6abe36.zip
Merge branch 'pci/controller/ixp4xx'
- Use the PCI_CONF1_ADDRESS() macro to simplify config space address computation (Pali Rohár) * pci/controller/ixp4xx: PCI: ixp4xx: Use PCI_CONF1_ADDRESS() macro
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/controller/pci-ixp4xx.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/pci/controller/pci-ixp4xx.c b/drivers/pci/controller/pci-ixp4xx.c
index 654ac4a82beb..e44252db6085 100644
--- a/drivers/pci/controller/pci-ixp4xx.c
+++ b/drivers/pci/controller/pci-ixp4xx.c
@@ -26,6 +26,7 @@
#include <linux/platform_device.h>
#include <linux/slab.h>
#include <linux/bits.h>
+#include "../pci.h"
/* Register offsets */
#define IXP4XX_PCI_NP_AD 0x00
@@ -188,12 +189,13 @@ 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 BIT(32-PCI_SLOT(devfn)) | ((PCI_FUNC(devfn)) << 8) |
- (where & ~3);
+ return (PCI_CONF1_ADDRESS(0, 0, PCI_FUNC(devfn), where) &
+ ~PCI_CONF1_ENABLE) | BIT(32-PCI_SLOT(devfn));
} else {
/* type 1 */
- return (bus_num << 16) | ((PCI_SLOT(devfn)) << 11) |
- ((PCI_FUNC(devfn)) << 8) | (where & ~3) | 1;
+ return (PCI_CONF1_ADDRESS(bus_num, PCI_SLOT(devfn),
+ PCI_FUNC(devfn), where) &
+ ~PCI_CONF1_ENABLE) | 1;
}
}