tg3: remove redundant pm init code
Pci_enable_device() will set device pm state to D0, so it's no need to do it again in tg3_init_one(). Acked-by: Michael Chan <mchan@broadcom.com> Signed-off-by: Yijing Wang <wangyijing@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
6b1ea4b299
commit
5865fc1b6a
@@ -17195,7 +17195,7 @@ static int tg3_init_one(struct pci_dev *pdev,
|
|||||||
{
|
{
|
||||||
struct net_device *dev;
|
struct net_device *dev;
|
||||||
struct tg3 *tp;
|
struct tg3 *tp;
|
||||||
int i, err, pm_cap;
|
int i, err;
|
||||||
u32 sndmbx, rcvmbx, intmbx;
|
u32 sndmbx, rcvmbx, intmbx;
|
||||||
char str[40];
|
char str[40];
|
||||||
u64 dma_mask, persist_dma_mask;
|
u64 dma_mask, persist_dma_mask;
|
||||||
@@ -17217,25 +17217,10 @@ static int tg3_init_one(struct pci_dev *pdev,
|
|||||||
|
|
||||||
pci_set_master(pdev);
|
pci_set_master(pdev);
|
||||||
|
|
||||||
/* Find power-management capability. */
|
|
||||||
pm_cap = pci_find_capability(pdev, PCI_CAP_ID_PM);
|
|
||||||
if (pm_cap == 0) {
|
|
||||||
dev_err(&pdev->dev,
|
|
||||||
"Cannot find Power Management capability, aborting\n");
|
|
||||||
err = -EIO;
|
|
||||||
goto err_out_free_res;
|
|
||||||
}
|
|
||||||
|
|
||||||
err = pci_set_power_state(pdev, PCI_D0);
|
|
||||||
if (err) {
|
|
||||||
dev_err(&pdev->dev, "Transition to D0 failed, aborting\n");
|
|
||||||
goto err_out_free_res;
|
|
||||||
}
|
|
||||||
|
|
||||||
dev = alloc_etherdev_mq(sizeof(*tp), TG3_IRQ_MAX_VECS);
|
dev = alloc_etherdev_mq(sizeof(*tp), TG3_IRQ_MAX_VECS);
|
||||||
if (!dev) {
|
if (!dev) {
|
||||||
err = -ENOMEM;
|
err = -ENOMEM;
|
||||||
goto err_out_power_down;
|
goto err_out_free_res;
|
||||||
}
|
}
|
||||||
|
|
||||||
SET_NETDEV_DEV(dev, &pdev->dev);
|
SET_NETDEV_DEV(dev, &pdev->dev);
|
||||||
@@ -17243,7 +17228,7 @@ static int tg3_init_one(struct pci_dev *pdev,
|
|||||||
tp = netdev_priv(dev);
|
tp = netdev_priv(dev);
|
||||||
tp->pdev = pdev;
|
tp->pdev = pdev;
|
||||||
tp->dev = dev;
|
tp->dev = dev;
|
||||||
tp->pm_cap = pm_cap;
|
tp->pm_cap = pdev->pm_cap;
|
||||||
tp->rx_mode = TG3_DEF_RX_MODE;
|
tp->rx_mode = TG3_DEF_RX_MODE;
|
||||||
tp->tx_mode = TG3_DEF_TX_MODE;
|
tp->tx_mode = TG3_DEF_TX_MODE;
|
||||||
tp->irq_sync = 1;
|
tp->irq_sync = 1;
|
||||||
@@ -17581,9 +17566,6 @@ err_out_iounmap:
|
|||||||
err_out_free_dev:
|
err_out_free_dev:
|
||||||
free_netdev(dev);
|
free_netdev(dev);
|
||||||
|
|
||||||
err_out_power_down:
|
|
||||||
pci_set_power_state(pdev, PCI_D3hot);
|
|
||||||
|
|
||||||
err_out_free_res:
|
err_out_free_res:
|
||||||
pci_release_regions(pdev);
|
pci_release_regions(pdev);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user