• Gabriele Paoloni's avatar
    PCI: designware: Simplify dw_pcie_cfg_read/write() interfaces · 4c45852f
    Gabriele Paoloni authored
    Callers of dw_pcie_cfg_read() and dw_pcie_cfg_write() previously had to
    split the address into "addr" and "where".  The callees assumed "addr" was
    32-bit aligned (with zeros in the low two bits) and they used only the low
    two bits of "where".
    
    Accept the entire address in "addr" and drop the now-redundant "where"
    argument.  As an example, this replaces this:
    
      int dw_pcie_cfg_read(void __iomem *addr, int where, int size, u32 *val)
        *val = readb(addr + (where & 1));
    
    with this:
    
      int dw_pcie_cfg_read(void __iomem *addr, int size, u32 *val)
        *val = readb(addr):
    
    [bhelgaas: changelog, split access size change to separate patch]
    Signed-off-by: default avatarGabriele Paoloni <gabriele.paoloni@huawei.com>
    Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
    4c45852f
pcie-designware.h 2.69 KB