Commit aed5dec3 authored by Alexander Duyck's avatar Alexander Duyck Committed by David S. Miller

igb: remove check for needing an io port

Since igb supports only pci-e nics and there is no plan to support any
legacy pci parts in the driver there isn't really much need for checking to
see if an io port is needed.

In the unlikely event that we do begin supporting legacy pci parts then we
can see about adding this code back to the driver.
Signed-off-by: default avatarAlexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 83b7180d
...@@ -273,10 +273,6 @@ struct igb_adapter { ...@@ -273,10 +273,6 @@ struct igb_adapter {
unsigned int flags; unsigned int flags;
u32 eeprom_wol; u32 eeprom_wol;
/* for ioport free */
int bars;
int need_ioport;
struct igb_ring *multi_tx_table[IGB_MAX_TX_QUEUES]; struct igb_ring *multi_tx_table[IGB_MAX_TX_QUEUES];
unsigned int tx_ring_count; unsigned int tx_ring_count;
unsigned int rx_ring_count; unsigned int rx_ring_count;
......
...@@ -974,21 +974,6 @@ void igb_reset(struct igb_adapter *adapter) ...@@ -974,21 +974,6 @@ void igb_reset(struct igb_adapter *adapter)
igb_get_phy_info(&adapter->hw); igb_get_phy_info(&adapter->hw);
} }
/**
* igb_is_need_ioport - determine if an adapter needs ioport resources or not
* @pdev: PCI device information struct
*
* Returns true if an adapter needs ioport resources
**/
static int igb_is_need_ioport(struct pci_dev *pdev)
{
switch (pdev->device) {
/* Currently there are no adapters that need ioport resources */
default:
return false;
}
}
static const struct net_device_ops igb_netdev_ops = { static const struct net_device_ops igb_netdev_ops = {
.ndo_open = igb_open, .ndo_open = igb_open,
.ndo_stop = igb_close, .ndo_stop = igb_close,
...@@ -1032,17 +1017,8 @@ static int __devinit igb_probe(struct pci_dev *pdev, ...@@ -1032,17 +1017,8 @@ static int __devinit igb_probe(struct pci_dev *pdev,
u16 eeprom_data = 0, state = 0; u16 eeprom_data = 0, state = 0;
u16 eeprom_apme_mask = IGB_EEPROM_APME; u16 eeprom_apme_mask = IGB_EEPROM_APME;
u32 part_num; u32 part_num;
int bars, need_ioport;
/* do not allocate ioport bars when not needed */
need_ioport = igb_is_need_ioport(pdev);
if (need_ioport) {
bars = pci_select_bars(pdev, IORESOURCE_MEM | IORESOURCE_IO);
err = pci_enable_device(pdev);
} else {
bars = pci_select_bars(pdev, IORESOURCE_MEM);
err = pci_enable_device_mem(pdev); err = pci_enable_device_mem(pdev);
}
if (err) if (err)
return err; return err;
...@@ -1085,7 +1061,9 @@ static int __devinit igb_probe(struct pci_dev *pdev, ...@@ -1085,7 +1061,9 @@ static int __devinit igb_probe(struct pci_dev *pdev,
break; break;
} }
err = pci_request_selected_regions(pdev, bars, igb_driver_name); err = pci_request_selected_regions(pdev, pci_select_bars(pdev,
IORESOURCE_MEM),
igb_driver_name);
if (err) if (err)
goto err_pci_reg; goto err_pci_reg;
...@@ -1113,8 +1091,6 @@ static int __devinit igb_probe(struct pci_dev *pdev, ...@@ -1113,8 +1091,6 @@ static int __devinit igb_probe(struct pci_dev *pdev,
hw = &adapter->hw; hw = &adapter->hw;
hw->back = adapter; hw->back = adapter;
adapter->msg_enable = NETIF_MSG_DRV | NETIF_MSG_PROBE; adapter->msg_enable = NETIF_MSG_DRV | NETIF_MSG_PROBE;
adapter->bars = bars;
adapter->need_ioport = need_ioport;
mmio_start = pci_resource_start(pdev, 0); mmio_start = pci_resource_start(pdev, 0);
mmio_len = pci_resource_len(pdev, 0); mmio_len = pci_resource_len(pdev, 0);
...@@ -1361,7 +1337,8 @@ err_hw_init: ...@@ -1361,7 +1337,8 @@ err_hw_init:
err_ioremap: err_ioremap:
free_netdev(netdev); free_netdev(netdev);
err_alloc_etherdev: err_alloc_etherdev:
pci_release_selected_regions(pdev, bars); pci_release_selected_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);
...@@ -1420,7 +1397,8 @@ static void __devexit igb_remove(struct pci_dev *pdev) ...@@ -1420,7 +1397,8 @@ static void __devexit igb_remove(struct pci_dev *pdev)
iounmap(adapter->hw.hw_addr); iounmap(adapter->hw.hw_addr);
if (adapter->hw.flash_address) if (adapter->hw.flash_address)
iounmap(adapter->hw.flash_address); iounmap(adapter->hw.flash_address);
pci_release_selected_regions(pdev, adapter->bars); pci_release_selected_regions(pdev, pci_select_bars(pdev,
IORESOURCE_MEM));
free_netdev(netdev); free_netdev(netdev);
...@@ -4309,9 +4287,6 @@ static int igb_resume(struct pci_dev *pdev) ...@@ -4309,9 +4287,6 @@ static int igb_resume(struct pci_dev *pdev)
pci_set_power_state(pdev, PCI_D0); pci_set_power_state(pdev, PCI_D0);
pci_restore_state(pdev); pci_restore_state(pdev);
if (adapter->need_ioport)
err = pci_enable_device(pdev);
else
err = pci_enable_device_mem(pdev); err = pci_enable_device_mem(pdev);
if (err) { if (err) {
dev_err(&pdev->dev, dev_err(&pdev->dev,
...@@ -4423,12 +4398,7 @@ static pci_ers_result_t igb_io_slot_reset(struct pci_dev *pdev) ...@@ -4423,12 +4398,7 @@ static pci_ers_result_t igb_io_slot_reset(struct pci_dev *pdev)
pci_ers_result_t result; pci_ers_result_t result;
int err; int err;
if (adapter->need_ioport) if (pci_enable_device_mem(pdev)) {
err = pci_enable_device(pdev);
else
err = pci_enable_device_mem(pdev);
if (err) {
dev_err(&pdev->dev, dev_err(&pdev->dev,
"Cannot re-enable PCI device after reset.\n"); "Cannot re-enable PCI device after reset.\n");
result = PCI_ERS_RESULT_DISCONNECT; result = PCI_ERS_RESULT_DISCONNECT;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment