media: atomisp: Replace deprecated MSI APIs
authorSuraj Upadhyay <usuraj35@gmail.com>
Sun, 19 Jul 2020 14:26:23 +0000 (16:26 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Thu, 3 Sep 2020 08:59:55 +0000 (10:59 +0200)
Replace deprecated MSI IRQ enabler and disabler
with pci_alloc_irq_vectors and pci_free_irq_vectors respectively.
And as a result handle the returned error as appropriate.
Compile tested.

[mchehab: solved a merge conflict that renamed dev->pdev]

Signed-off-by: Suraj Upadhyay <usuraj35@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/staging/media/atomisp/pci/atomisp_v4l2.c

index a000a1e316f78d705f320cefd8f855b017ccd655..8c1d5a3b8f45ca34aad9d54d41ed978012213f7a 100644 (file)
@@ -1708,8 +1708,8 @@ static int atomisp_pci_probe(struct pci_dev *pdev, const struct pci_device_id *i
 
        pci_set_master(pdev);
 
-       err = pci_enable_msi(pdev);
-       if (err) {
+       err = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_MSI);
+       if (err < 0) {
                dev_err(&pdev->dev, "Failed to enable msi (%d)\n", err);
                goto enable_msi_fail;
        }
@@ -1827,7 +1827,7 @@ register_entities_fail:
 initialize_modules_fail:
        cpu_latency_qos_remove_request(&isp->pm_qos);
        atomisp_msi_irq_uninit(isp);
-       pci_disable_msi(pdev);
+       pci_free_irq_vectors(pdev);
 enable_msi_fail:
 fw_validation_fail:
        release_firmware(isp->firmware);