@@ -554,14 +554,9 @@ static int loongson_dwmac_probe(struct pci_dev *pdev, const struct pci_device_id
pci_set_master(pdev);
/* Get the base address of device */
- for (i = 0; i < PCI_STD_NUM_BARS; i++) {
- if (pci_resource_len(pdev, i) == 0)
- continue;
- ret = pcim_iomap_regions(pdev, BIT(0), DRIVER_NAME);
- if (ret)
- goto err_disable_device;
- break;
- }
+ ret = pcim_iomap_regions(pdev, BIT(0), DRIVER_NAME);
+ if (ret)
+ goto err_disable_device;
memset(&res, 0, sizeof(res));
res.addr = pcim_iomap_table(pdev)[0];
loongson_dwmac_probe() contains a loop which doesn't have an effect, because it tries to call pcim_iomap_regions() with the same parameters several times. The break statement at the loop's end furthermore ensures that the loop only runs once anyways. Remove the surplus loop. Signed-off-by: Philipp Stanner <phasta@kernel.org> --- drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-)