linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] char: xillybus: Replace deprecated MSI API
@ 2025-07-16 19:39 Salah Triki
  2025-07-17 13:51 ` Eli Billauer
  0 siblings, 1 reply; 13+ messages in thread
From: Salah Triki @ 2025-07-16 19:39 UTC (permalink / raw)
  To: Eli Billauer, Arnd Bergmann, Greg Kroah-Hartman, linux-kernel; +Cc: salah.triki

Replace deprecated pci_enable_msi() with pci_alloc_irq_vectors(). And
add pci_free_irq_vectors() to free the allocated vectors before removing
the device.

Signed-off-by: Salah Triki <salah.triki@gmail.com>
---
 drivers/char/xillybus/xillybus_pcie.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/char/xillybus/xillybus_pcie.c b/drivers/char/xillybus/xillybus_pcie.c
index 9858711e3e79..fc7bffbd36ed 100644
--- a/drivers/char/xillybus/xillybus_pcie.c
+++ b/drivers/char/xillybus/xillybus_pcie.c
@@ -76,7 +76,8 @@ static int xilly_probe(struct pci_dev *pdev,
 	pci_set_master(pdev);
 
 	/* Set up a single MSI interrupt */
-	if (pci_enable_msi(pdev)) {
+	rc = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_ALL_TYPES);
+	if (rc < 0) {
 		dev_err(endpoint->dev,
 			"Failed to enable MSI interrupts. Aborting.\n");
 		return -ENODEV;
@@ -112,6 +113,8 @@ static void xilly_remove(struct pci_dev *pdev)
 {
 	struct xilly_endpoint *endpoint = pci_get_drvdata(pdev);
 
+	pci_free_irq_vectors(pdev);
+
 	xillybus_endpoint_remove(endpoint);
 }
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2025-07-21  5:42 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-16 19:39 [PATCH] char: xillybus: Replace deprecated MSI API Salah Triki
2025-07-17 13:51 ` Eli Billauer
2025-07-17 16:26   ` [PATCH v2] " Salah Triki
2025-07-18  0:55     ` [PATCH v3] " Salah Triki
2025-07-18 14:19       ` Eli Billauer
2025-07-19  4:51         ` [PATCH v4] " Salah Triki
2025-07-19 12:22           ` Eli Billauer
2025-07-19 12:35             ` Salah Triki
2025-07-20  8:33           ` Greg Kroah-Hartman
2025-07-20  8:56             ` Salah Triki
2025-07-20  9:07               ` Greg Kroah-Hartman
2025-07-20 17:03                 ` Salah Triki
2025-07-21  5:41                   ` Greg Kroah-Hartman

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).