All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] media: staging/ipu7: convert to use pci_alloc_irq_vectors() API
@ 2025-08-15  9:20 bingbu.cao
  2025-08-15  9:20 ` [PATCH 2/3] media: staging/ipu7: Don't set name for IPU7 PCI device bingbu.cao
  2025-08-15  9:20 ` [PATCH 3/3] media: staging/ipu7: cleanup the MMU correctly in IPU7 driver release bingbu.cao
  0 siblings, 2 replies; 5+ messages in thread
From: bingbu.cao @ 2025-08-15  9:20 UTC (permalink / raw)
  To: linux-media, sakari.ailus, laurent.pinchart
  Cc: tomi.valkeinen, hans, jacopo.mondi, bingbu.cao, bingbu.cao

From: Bingbu Cao <bingbu.cao@intel.com>

pci_enable_msi() is a deprecated API, thus switch to use modern
pci_alloc_irq_vectors().

Fixes: b7fe4c0019b1 ("media: staging/ipu7: add Intel IPU7 PCI device driver")
Signed-off-by: Bingbu Cao <bingbu.cao@intel.com>
---
 drivers/staging/media/ipu7/ipu7.c | 21 +++++++++------------
 1 file changed, 9 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/media/ipu7/ipu7.c b/drivers/staging/media/ipu7/ipu7.c
index 1b4f01db13ca..a8e8b0e23198 100644
--- a/drivers/staging/media/ipu7/ipu7.c
+++ b/drivers/staging/media/ipu7/ipu7.c
@@ -2248,20 +2248,13 @@ void ipu7_dump_fw_error_log(const struct ipu7_bus_device *adev)
 }
 EXPORT_SYMBOL_NS_GPL(ipu7_dump_fw_error_log, "INTEL_IPU7");
 
-static int ipu7_pci_config_setup(struct pci_dev *dev)
+static void ipu7_pci_config_setup(struct pci_dev *dev)
 {
 	u16 pci_command;
-	int ret;
 
 	pci_read_config_word(dev, PCI_COMMAND, &pci_command);
 	pci_command |= PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER;
 	pci_write_config_word(dev, PCI_COMMAND, pci_command);
-
-	ret = pci_enable_msi(dev);
-	if (ret)
-		dev_err(&dev->dev, "Failed to enable msi (%d)\n", ret);
-
-	return ret;
 }
 
 static int ipu7_map_fw_code_region(struct ipu7_bus_device *sys,
@@ -2510,13 +2503,15 @@ static int ipu7_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 
 	dma_set_max_seg_size(dev, UINT_MAX);
 
-	ret = ipu7_pci_config_setup(pdev);
-	if (ret)
-		return ret;
+	ipu7_pci_config_setup(pdev);
+
+	ret = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_ALL_TYPES);
+	if (ret < 0)
+		return dev_err_probe(dev, ret, "Failed to alloc irq vector\n");
 
 	ret = ipu_buttress_init(isp);
 	if (ret)
-		return ret;
+		goto pci_irq_free;
 
 	dev_info(dev, "firmware cpd file: %s\n", isp->cpd_fw_name);
 
@@ -2632,6 +2627,8 @@ static int ipu7_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 	release_firmware(isp->cpd_fw);
 buttress_exit:
 	ipu_buttress_exit(isp);
+pci_irq_free:
+	pci_free_irq_vectors(pdev);
 
 	return ret;
 }
-- 
2.34.1


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

end of thread, other threads:[~2025-08-18  2:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-15  9:20 [PATCH 1/3] media: staging/ipu7: convert to use pci_alloc_irq_vectors() API bingbu.cao
2025-08-15  9:20 ` [PATCH 2/3] media: staging/ipu7: Don't set name for IPU7 PCI device bingbu.cao
2025-08-15  9:20 ` [PATCH 3/3] media: staging/ipu7: cleanup the MMU correctly in IPU7 driver release bingbu.cao
2025-08-15 21:26   ` Sakari Ailus
2025-08-18  2:27     ` Bingbu Cao

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.