提交 c3eb7a77 编写于 作者: Y Yijing Wang 提交者: David S. Miller

alx: remove redundant D0 power state set

Pci_enable_device_mem() will set device power state to D0,
so it's no need to do it again in alx_probe().
Also remove redundant PM Cap find code, because pci core
has been saved the pci device pm cap value.
Signed-off-by: NYijing Wang <wangyijing@huawei.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 922bbe88
...@@ -1188,7 +1188,7 @@ static int alx_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -1188,7 +1188,7 @@ static int alx_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
struct alx_priv *alx; struct alx_priv *alx;
struct alx_hw *hw; struct alx_hw *hw;
bool phy_configured; bool phy_configured;
int bars, pm_cap, err; int bars, err;
err = pci_enable_device_mem(pdev); err = pci_enable_device_mem(pdev);
if (err) if (err)
...@@ -1225,18 +1225,13 @@ static int alx_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -1225,18 +1225,13 @@ static int alx_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
pci_enable_pcie_error_reporting(pdev); pci_enable_pcie_error_reporting(pdev);
pci_set_master(pdev); pci_set_master(pdev);
pm_cap = pci_find_capability(pdev, PCI_CAP_ID_PM); if (!pdev->pm_cap) {
if (pm_cap == 0) {
dev_err(&pdev->dev, dev_err(&pdev->dev,
"Can't find power management capability, aborting\n"); "Can't find power management capability, aborting\n");
err = -EIO; err = -EIO;
goto out_pci_release; goto out_pci_release;
} }
err = pci_set_power_state(pdev, PCI_D0);
if (err)
goto out_pci_release;
netdev = alloc_etherdev(sizeof(*alx)); netdev = alloc_etherdev(sizeof(*alx));
if (!netdev) { if (!netdev) {
err = -ENOMEM; err = -ENOMEM;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册