Skip to content

Commit 73af737

Browse files
committed
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
2 parents 0c78d41 + 6c6fa1f commit 73af737

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

drivers/pci/controller/pci-ixp4xx.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include <linux/platform_device.h>
2727
#include <linux/slab.h>
2828
#include <linux/bits.h>
29+
#include "../pci.h"
2930

3031
/* Register offsets */
3132
#define IXP4XX_PCI_NP_AD 0x00
@@ -188,12 +189,13 @@ static u32 ixp4xx_config_addr(u8 bus_num, u16 devfn, int where)
188189
/* Root bus is always 0 in this hardware */
189190
if (bus_num == 0) {
190191
/* type 0 */
191-
return BIT(32-PCI_SLOT(devfn)) | ((PCI_FUNC(devfn)) << 8) |
192-
(where & ~3);
192+
return (PCI_CONF1_ADDRESS(0, 0, PCI_FUNC(devfn), where) &
193+
~PCI_CONF1_ENABLE) | BIT(32-PCI_SLOT(devfn));
193194
} else {
194195
/* type 1 */
195-
return (bus_num << 16) | ((PCI_SLOT(devfn)) << 11) |
196-
((PCI_FUNC(devfn)) << 8) | (where & ~3) | 1;
196+
return (PCI_CONF1_ADDRESS(bus_num, PCI_SLOT(devfn),
197+
PCI_FUNC(devfn), where) &
198+
~PCI_CONF1_ENABLE) | 1;
197199
}
198200
}
199201

0 commit comments

Comments
 (0)