Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: ipu3-cio2: Request IRQ earlier

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>

authored by

Sakari Ailus and committed by
Hans Verkuil
a069f79b d8c9a6e2

+5 -5
+5 -5
drivers/media/pci/intel/ipu3/ipu3-cio2.c
··· 1752 1752 1753 1753 v4l2_async_nf_init(&cio2->notifier, &cio2->v4l2_dev); 1754 1754 1755 - /* Register notifier for subdevices we care */ 1756 - r = cio2_parse_firmware(cio2); 1757 - if (r) 1758 - goto fail_clean_notifier; 1759 - 1760 1755 r = devm_request_irq(dev, pci_dev->irq, cio2_irq, IRQF_SHARED, 1761 1756 CIO2_NAME, cio2); 1762 1757 if (r) { 1763 1758 dev_err(dev, "failed to request IRQ (%d)\n", r); 1764 1759 goto fail_clean_notifier; 1765 1760 } 1761 + 1762 + /* Register notifier for subdevices we care */ 1763 + r = cio2_parse_firmware(cio2); 1764 + if (r) 1765 + goto fail_clean_notifier; 1766 1766 1767 1767 pm_runtime_put_noidle(dev); 1768 1768 pm_runtime_allow(dev);