media: atomisp: Fix atomisp_pci_remove()
authorHans de Goede <hdegoede@redhat.com>
Wed, 27 Dec 2023 21:47:45 +0000 (22:47 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Thu, 1 Feb 2024 06:03:07 +0000 (07:03 +0100)
Fix atomisp_pci_remove():
-Remove uninformative "Removing atomisp driver" log message
-Add missing devm_free_irq(), atomisp_uninitialize_modules() and
 pci_free_irq_vectors() calls
-Move atomisp_msi_irq_uninit() down so that the remove() order is
 an exact mirror of the probe() order

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/staging/media/atomisp/pci/atomisp_v4l2.c

index 336c5a895ecc4ba78065a23e24eab2745789a3e8..f3bd2c03dea5ca6fafe028559e2bdff79e048d44 100644 (file)
@@ -1524,11 +1524,10 @@ static void atomisp_pci_remove(struct pci_dev *pdev)
 {
        struct atomisp_device *isp = pci_get_drvdata(pdev);
 
-       dev_info(&pdev->dev, "Removing atomisp driver\n");
-
        atomisp_drvfs_exit();
 
        ia_css_unload_firmware();
+       devm_free_irq(&pdev->dev, pdev->irq, isp);
        hmm_cleanup();
 
        pm_runtime_forbid(&pdev->dev);
@@ -1536,8 +1535,10 @@ static void atomisp_pci_remove(struct pci_dev *pdev)
        dev_pm_domain_set(&pdev->dev, NULL);
        cpu_latency_qos_remove_request(&isp->pm_qos);
 
-       atomisp_msi_irq_uninit(isp);
        atomisp_unregister_entities(isp);
+       atomisp_uninitialize_modules(isp);
+       atomisp_msi_irq_uninit(isp);
+       pci_free_irq_vectors(pdev);
 }
 
 static const struct pci_device_id atomisp_pci_tbl[] = {