]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
soc/tegra: pmc: Fail to allocate more than one wake IRQ
authorThierry Reding <treding@nvidia.com>
Mon, 27 May 2019 10:15:12 +0000 (12:15 +0200)
committerThierry Reding <treding@nvidia.com>
Wed, 5 Jun 2019 07:52:53 +0000 (09:52 +0200)
The code currently doesn't support allocating more than one wake IRQ at
a time. Detect this situation and error out. Also make sure to output a
warning when that happens to help track down callers.

Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
drivers/soc/tegra/pmc.c

index 5648e5c09ef5476a92d5ed2613c20b9b9777a348..653fe2c466f631a1661b3991e2c9c51a3469b8f5 100644 (file)
@@ -1863,6 +1863,9 @@ static int tegra_pmc_irq_alloc(struct irq_domain *domain, unsigned int virq,
        unsigned int i;
        int err = 0;
 
+       if (WARN_ON(num_irqs > 1))
+               return -EINVAL;
+
        for (i = 0; i < soc->num_wake_events; i++) {
                const struct tegra_wake_event *event = &soc->wake_events[i];