mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2025-01-19 04:14:49 +08:00
stmmac: intel: Convert to use pci_alloc_irq_vectors() API
pci_enable_msi() is deprecated API, thus, switch to modern pci_alloc_irq_vectors(). Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
e578f043ff
commit
52c1f79484
@ -649,15 +649,18 @@ static int intel_eth_pci_probe(struct pci_dev *pdev,
|
|||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
pci_enable_msi(pdev);
|
ret = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_ALL_TYPES);
|
||||||
|
if (ret < 0)
|
||||||
|
return ret;
|
||||||
|
|
||||||
memset(&res, 0, sizeof(res));
|
memset(&res, 0, sizeof(res));
|
||||||
res.addr = pcim_iomap_table(pdev)[0];
|
res.addr = pcim_iomap_table(pdev)[0];
|
||||||
res.wol_irq = pdev->irq;
|
res.wol_irq = pci_irq_vector(pdev, 0);
|
||||||
res.irq = pdev->irq;
|
res.irq = pci_irq_vector(pdev, 0);
|
||||||
|
|
||||||
ret = stmmac_dvr_probe(&pdev->dev, plat, &res);
|
ret = stmmac_dvr_probe(&pdev->dev, plat, &res);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
|
pci_free_irq_vectors(pdev);
|
||||||
clk_disable_unprepare(plat->stmmac_clk);
|
clk_disable_unprepare(plat->stmmac_clk);
|
||||||
clk_unregister_fixed_rate(plat->stmmac_clk);
|
clk_unregister_fixed_rate(plat->stmmac_clk);
|
||||||
}
|
}
|
||||||
@ -679,6 +682,8 @@ static void intel_eth_pci_remove(struct pci_dev *pdev)
|
|||||||
|
|
||||||
stmmac_dvr_remove(&pdev->dev);
|
stmmac_dvr_remove(&pdev->dev);
|
||||||
|
|
||||||
|
pci_free_irq_vectors(pdev);
|
||||||
|
|
||||||
clk_disable_unprepare(priv->plat->stmmac_clk);
|
clk_disable_unprepare(priv->plat->stmmac_clk);
|
||||||
clk_unregister_fixed_rate(priv->plat->stmmac_clk);
|
clk_unregister_fixed_rate(priv->plat->stmmac_clk);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user