spi: dw-pci: apply pci_bar and re-use pci_name
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Fri, 29 Aug 2014 09:41:40 +0000 (12:41 +0300)
committerMark Brown <broonie@kernel.org>
Mon, 1 Sep 2014 10:29:02 +0000 (11:29 +0100)
Nevertheless pci_bar is 0 let's explicitly use it when map IO regions. While
here, use pci_name instead of dev_name.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-dw-pci.c

index 0ac86a58dd277b9bc04479d20ba55ad5dbc0ad16..e203d8fc0ce6c83cfd5c3eda6d923584992c9625 100644 (file)
@@ -55,7 +55,7 @@ static int spi_pci_probe(struct pci_dev *pdev,
        /* Get basic io resource and map it */
        dws->paddr = pci_resource_start(pdev, pci_bar);
 
-       ret = pcim_iomap_regions(pdev, 1, dev_name(&pdev->dev));
+       ret = pcim_iomap_regions(pdev, 1 << pci_bar, pci_name(pdev));
        if (ret)
                return ret;