]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
media: ipu3-cio2: Request IRQ earlier
authorSakari Ailus <sakari.ailus@linux.intel.com>
Tue, 20 Dec 2022 14:01:20 +0000 (16:01 +0200)
committerHans Verkuil <hverkuil-cisco@xs4all.nl>
Wed, 10 Apr 2024 13:15:30 +0000 (15:15 +0200)
Call devm_request_irq() before registering the async notifier, as otherwise
it would be possible to use the device before the interrupts could be
delivered to the driver.

Fixes: c2a6a07afe4a ("media: intel-ipu3: cio2: add new MIPI-CSI2 driver")
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
drivers/media/pci/intel/ipu3/ipu3-cio2.c

index c42adc5a408db5470d45ca02900e3e8f4d34d297..00090e7f5f9da6001854e60af48147b5158babee 100644 (file)
@@ -1752,11 +1752,6 @@ static int cio2_pci_probe(struct pci_dev *pci_dev,
 
        v4l2_async_nf_init(&cio2->notifier, &cio2->v4l2_dev);
 
-       /* Register notifier for subdevices we care */
-       r = cio2_parse_firmware(cio2);
-       if (r)
-               goto fail_clean_notifier;
-
        r = devm_request_irq(dev, pci_dev->irq, cio2_irq, IRQF_SHARED,
                             CIO2_NAME, cio2);
        if (r) {
@@ -1764,6 +1759,11 @@ static int cio2_pci_probe(struct pci_dev *pci_dev,
                goto fail_clean_notifier;
        }
 
+       /* Register notifier for subdevices we care */
+       r = cio2_parse_firmware(cio2);
+       if (r)
+               goto fail_clean_notifier;
+
        pm_runtime_put_noidle(dev);
        pm_runtime_allow(dev);