ethernet/intel: Use pci_(request|release)_mem_regions

Now that we do have pci_request_mem_regions() and pci_release_mem_regions()
at hand, use it in the Intel ethernet drivers.

Suggested-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Acked-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
CC: David S. Miller <davem@davemloft.net>
This commit is contained in:
Johannes Thumshirn 2016-06-07 09:44:05 +02:00 committed by Bjorn Helgaas
parent f03774bdcf
commit 56d766d64c
5 changed files with 14 additions and 31 deletions

View File

@ -7321,8 +7321,7 @@ err_flashmap:
err_ioremap: err_ioremap:
free_netdev(netdev); free_netdev(netdev);
err_alloc_etherdev: err_alloc_etherdev:
pci_release_selected_regions(pdev, pci_release_mem_regions(pdev);
pci_select_bars(pdev, IORESOURCE_MEM));
err_pci_reg: err_pci_reg:
err_dma: err_dma:
pci_disable_device(pdev); pci_disable_device(pdev);
@ -7389,8 +7388,7 @@ static void e1000_remove(struct pci_dev *pdev)
if ((adapter->hw.flash_address) && if ((adapter->hw.flash_address) &&
(adapter->hw.mac.type < e1000_pch_spt)) (adapter->hw.mac.type < e1000_pch_spt))
iounmap(adapter->hw.flash_address); iounmap(adapter->hw.flash_address);
pci_release_selected_regions(pdev, pci_release_mem_regions(pdev);
pci_select_bars(pdev, IORESOURCE_MEM));
free_netdev(netdev); free_netdev(netdev);

View File

@ -1869,10 +1869,7 @@ static int fm10k_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
goto err_dma; goto err_dma;
} }
err = pci_request_selected_regions(pdev, err = pci_request_mem_regions(pdev, fm10k_driver_name);
pci_select_bars(pdev,
IORESOURCE_MEM),
fm10k_driver_name);
if (err) { if (err) {
dev_err(&pdev->dev, dev_err(&pdev->dev,
"pci_request_selected_regions failed: %d\n", err); "pci_request_selected_regions failed: %d\n", err);
@ -1976,8 +1973,7 @@ err_sw_init:
err_ioremap: err_ioremap:
free_netdev(netdev); free_netdev(netdev);
err_alloc_netdev: err_alloc_netdev:
pci_release_selected_regions(pdev, pci_release_mem_regions(pdev);
pci_select_bars(pdev, IORESOURCE_MEM));
err_pci_reg: err_pci_reg:
err_dma: err_dma:
pci_disable_device(pdev); pci_disable_device(pdev);
@ -2025,8 +2021,7 @@ static void fm10k_remove(struct pci_dev *pdev)
free_netdev(netdev); free_netdev(netdev);
pci_release_selected_regions(pdev, pci_release_mem_regions(pdev);
pci_select_bars(pdev, IORESOURCE_MEM));
pci_disable_pcie_error_reporting(pdev); pci_disable_pcie_error_reporting(pdev);

View File

@ -10769,8 +10769,7 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
} }
/* set up pci connections */ /* set up pci connections */
err = pci_request_selected_regions(pdev, pci_select_bars(pdev, err = pci_request_mem_regions(pdev, i40e_driver_name);
IORESOURCE_MEM), i40e_driver_name);
if (err) { if (err) {
dev_info(&pdev->dev, dev_info(&pdev->dev,
"pci_request_selected_regions failed %d\n", err); "pci_request_selected_regions failed %d\n", err);
@ -11267,8 +11266,7 @@ err_ioremap:
kfree(pf); kfree(pf);
err_pf_alloc: err_pf_alloc:
pci_disable_pcie_error_reporting(pdev); pci_disable_pcie_error_reporting(pdev);
pci_release_selected_regions(pdev, pci_release_mem_regions(pdev);
pci_select_bars(pdev, IORESOURCE_MEM));
err_pci_reg: err_pci_reg:
err_dma: err_dma:
pci_disable_device(pdev); pci_disable_device(pdev);
@ -11379,8 +11377,7 @@ static void i40e_remove(struct pci_dev *pdev)
iounmap(hw->hw_addr); iounmap(hw->hw_addr);
kfree(pf); kfree(pf);
pci_release_selected_regions(pdev, pci_release_mem_regions(pdev);
pci_select_bars(pdev, IORESOURCE_MEM));
pci_disable_pcie_error_reporting(pdev); pci_disable_pcie_error_reporting(pdev);
pci_disable_device(pdev); pci_disable_device(pdev);

View File

@ -2323,9 +2323,7 @@ static int igb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
} }
} }
err = pci_request_selected_regions(pdev, pci_select_bars(pdev, err = pci_request_mem_regions(pdev, igb_driver_name);
IORESOURCE_MEM),
igb_driver_name);
if (err) if (err)
goto err_pci_reg; goto err_pci_reg;
@ -2749,8 +2747,7 @@ err_sw_init:
err_ioremap: err_ioremap:
free_netdev(netdev); free_netdev(netdev);
err_alloc_etherdev: err_alloc_etherdev:
pci_release_selected_regions(pdev, pci_release_mem_regions(pdev);
pci_select_bars(pdev, IORESOURCE_MEM));
err_pci_reg: err_pci_reg:
err_dma: err_dma:
pci_disable_device(pdev); pci_disable_device(pdev);
@ -2915,8 +2912,7 @@ static void igb_remove(struct pci_dev *pdev)
pci_iounmap(pdev, adapter->io_addr); pci_iounmap(pdev, adapter->io_addr);
if (hw->flash_address) if (hw->flash_address)
iounmap(hw->flash_address); iounmap(hw->flash_address);
pci_release_selected_regions(pdev, pci_release_mem_regions(pdev);
pci_select_bars(pdev, IORESOURCE_MEM));
kfree(adapter->shadow_vfta); kfree(adapter->shadow_vfta);
free_netdev(netdev); free_netdev(netdev);

View File

@ -9331,8 +9331,7 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
pci_using_dac = 0; pci_using_dac = 0;
} }
err = pci_request_selected_regions(pdev, pci_select_bars(pdev, err = pci_request_mem_regions(pdev, ixgbe_driver_name);
IORESOURCE_MEM), ixgbe_driver_name);
if (err) { if (err) {
dev_err(&pdev->dev, dev_err(&pdev->dev,
"pci_request_selected_regions failed 0x%x\n", err); "pci_request_selected_regions failed 0x%x\n", err);
@ -9718,8 +9717,7 @@ err_ioremap:
disable_dev = !test_and_set_bit(__IXGBE_DISABLED, &adapter->state); disable_dev = !test_and_set_bit(__IXGBE_DISABLED, &adapter->state);
free_netdev(netdev); free_netdev(netdev);
err_alloc_etherdev: err_alloc_etherdev:
pci_release_selected_regions(pdev, pci_release_mem_regions(pdev);
pci_select_bars(pdev, IORESOURCE_MEM));
err_pci_reg: err_pci_reg:
err_dma: err_dma:
if (!adapter || disable_dev) if (!adapter || disable_dev)
@ -9786,8 +9784,7 @@ static void ixgbe_remove(struct pci_dev *pdev)
#endif #endif
iounmap(adapter->io_addr); iounmap(adapter->io_addr);
pci_release_selected_regions(pdev, pci_select_bars(pdev, pci_release_mem_regions(pdev);
IORESOURCE_MEM));
e_dev_info("complete\n"); e_dev_info("complete\n");