summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergio Paracuellos <sergio.paracuellos@gmail.com>2019-01-07 20:31:43 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-01-15 16:08:36 +0100
commit7c106cbb2ba8c86bedd2868b690aee8965476b3b (patch)
treeabd1deced3699dc904303d65b1f7cde89cc0a113
parent0a54ea9f481f1a2ca5a171e91ddaacb75040f287 (diff)
staging: mt7621-pci: use PCI definitions instead of hardcode values
Seting up ports to enable PCI_COMMAND_MASTER is using '0x4' as a hardcore value and '0x4' also for PCI_COMMAND register instead of use definitions from linux pci system headers. Replace both. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/mt7621-pci/pci-mt7621.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b/drivers/staging/mt7621-pci/pci-mt7621.c
index 8db94fdbdd6d..507b8c68d20b 100644
--- a/drivers/staging/mt7621-pci/pci-mt7621.c
+++ b/drivers/staging/mt7621-pci/pci-mt7621.c
@@ -515,8 +515,9 @@ static void mt7621_pcie_enable_ports(struct mt7621_pcie *pcie)
}
for (slot = 0; slot < num_slots_enabled; slot++) {
- val = read_config(pcie, slot, 0x4);
- write_config(pcie, slot, 0x4, val | 0x4);
+ val = read_config(pcie, slot, PCI_COMMAND);
+ val |= PCI_COMMAND_MASTER;
+ write_config(pcie, slot, PCI_COMMAND, val);
/* configure RC FTS number to 250 when it leaves L0s */
val = read_config(pcie, slot, PCIE_FTS_NUM);
val &= ~PCIE_FTS_NUM_MASK;