mirror of
https://github.com/torvalds/linux.git
synced 2026-05-05 23:05:25 -04:00
media: staging/ipu7: convert to use pci_alloc_irq_vectors() API
pci_enable_msi() is a deprecated API, thus switch to use modern
pci_alloc_irq_vectors().
Fixes: b7fe4c0019 ("media: staging/ipu7: add Intel IPU7 PCI device driver")
Signed-off-by: Bingbu Cao <bingbu.cao@intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
This commit is contained in:
@@ -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 @@ out_ipu_bus_del_devices:
|
||||
release_firmware(isp->cpd_fw);
|
||||
buttress_exit:
|
||||
ipu_buttress_exit(isp);
|
||||
pci_irq_free:
|
||||
pci_free_irq_vectors(pdev);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user