From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Giuseppe Cavallaro <peppe.cavallaro@st.com>,
Alexandre Torgue <alexandre.torgue@st.com>,
Jose Abreu <joabreu@synopsys.com>,
linux-stm32@st-md-mailman.stormreply.com,
"David S. Miller" <davem@davemloft.net>,
netdev@vger.kernel.org
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Subject: [PATCH v1 3/5] stmmac: intel: Convert to use pci_alloc_irq_vectors() API
Date: Wed, 29 Apr 2020 17:04:47 +0300 [thread overview]
Message-ID: <20200429140449.9484-3-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20200429140449.9484-1-andriy.shevchenko@linux.intel.com>
pci_enable_msi() is deprecated API, thus, switch to modern
pci_alloc_irq_vectors().
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c
index 87743036df78b3..46e3e4d6a34ac8 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c
@@ -649,15 +649,18 @@ static int intel_eth_pci_probe(struct pci_dev *pdev,
if (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));
res.addr = pcim_iomap_table(pdev)[0];
- res.wol_irq = pdev->irq;
- res.irq = pdev->irq;
+ res.wol_irq = pci_irq_vector(pdev, 0);
+ res.irq = pci_irq_vector(pdev, 0);
ret = stmmac_dvr_probe(&pdev->dev, plat, &res);
if (ret) {
+ pci_free_irq_vectors(pdev);
clk_unregister_fixed_rate(plat->stmmac_clk);
}
@@ -678,6 +681,8 @@ static void intel_eth_pci_remove(struct pci_dev *pdev)
stmmac_dvr_remove(&pdev->dev);
+ pci_free_irq_vectors(pdev);
+
clk_unregister_fixed_rate(priv->plat->stmmac_clk);
pcim_iounmap_regions(pdev, BIT(0));
--
2.26.2
next prev parent reply other threads:[~2020-04-29 14:04 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-29 14:04 [PATCH v1 1/5] stmmac: intel: Check return value of clk_prepare_enable() Andy Shevchenko
2020-04-29 14:04 ` [PATCH v1 2/5] stmmac: intel: Remove unnecessary loop for PCI BARs Andy Shevchenko
2020-04-29 14:04 ` Andy Shevchenko [this message]
2020-04-29 14:04 ` [PATCH v1 4/5] stmmac: intel: Eliminate useless conditions and variables Andy Shevchenko
2020-04-29 14:04 ` [PATCH v1 5/5] stmmac: intel: Fix indentation to put on one line affected code Andy Shevchenko
2020-04-29 14:22 ` [PATCH v1 1/5] stmmac: intel: Check return value of clk_prepare_enable() Andy Shevchenko
2020-04-29 19:13 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200429140449.9484-3-andriy.shevchenko@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=alexandre.torgue@st.com \
--cc=davem@davemloft.net \
--cc=joabreu@synopsys.com \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=netdev@vger.kernel.org \
--cc=peppe.cavallaro@st.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).