Merge tag 'leds-for-5.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/j.anasz...
[sfrench/cifs-2.6.git] / drivers / base / platform.c
index a174ce5ea17ccbd9df1ad66da3cd5082ebb2fc3c..eb018378d60a7780e369aa94bb3cc37b7e480cac 100644 (file)
@@ -157,8 +157,13 @@ int platform_get_irq(struct platform_device *dev, unsigned int num)
         * the device will only expose one IRQ, and this fallback
         * allows a common code path across either kind of resource.
         */
-       if (num == 0 && has_acpi_companion(&dev->dev))
-               return acpi_dev_gpio_irq_get(ACPI_COMPANION(&dev->dev), num);
+       if (num == 0 && has_acpi_companion(&dev->dev)) {
+               int ret = acpi_dev_gpio_irq_get(ACPI_COMPANION(&dev->dev), num);
+
+               /* Our callers expect -ENXIO for missing IRQs. */
+               if (ret >= 0 || ret == -EPROBE_DEFER)
+                       return ret;
+       }
 
        return -ENXIO;
 #endif