]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
staging: mt7621-pci: use PCI definitions instead of hardcode values
authorSergio Paracuellos <sergio.paracuellos@gmail.com>
Mon, 7 Jan 2019 19:31:43 +0000 (20:31 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 15 Jan 2019 15:08:36 +0000 (16:08 +0100)
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>
drivers/staging/mt7621-pci/pci-mt7621.c

index 8db94fdbdd6d0d7e03506c547bcdbee1963ae664..507b8c68d20b6d4b81f092749396651a68d1d65d 100644 (file)
@@ -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;