aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/platform.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/base/platform.c')
-rw-r--r--drivers/base/platform.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index 1c958eb33ef4..0d3611cd1b3b 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -127,7 +127,20 @@ int platform_get_irq(struct platform_device *dev, unsigned int num)
127 irqd_set_trigger_type(irqd, r->flags & IORESOURCE_BITS); 127 irqd_set_trigger_type(irqd, r->flags & IORESOURCE_BITS);
128 } 128 }
129 129
130 return r ? r->start : -ENXIO; 130 if (r)
131 return r->start;
132
133 /*
134 * For the index 0 interrupt, allow falling back to GpioInt
135 * resources. While a device could have both Interrupt and GpioInt
136 * resources, making this fallback ambiguous, in many common cases
137 * the device will only expose one IRQ, and this fallback
138 * allows a common code path across either kind of resource.
139 */
140 if (num == 0 && has_acpi_companion(&dev->dev))
141 return acpi_dev_gpio_irq_get(ACPI_COMPANION(&dev->dev), num);
142
143 return -ENXIO;
131#endif 144#endif
132} 145}
133EXPORT_SYMBOL_GPL(platform_get_irq); 146EXPORT_SYMBOL_GPL(platform_get_irq);