diff options
author | Thierry Reding <treding@nvidia.com> | 2019-05-27 12:15:12 +0200 |
---|---|---|
committer | Thierry Reding <treding@nvidia.com> | 2019-06-05 09:52:53 +0200 |
commit | 77226d97725034542caadf97a4bb9969d5838ee8 (patch) | |
tree | e9f7c0cada39356c8d83ee7169a464b3f1b7aee8 /drivers/soc | |
parent | a188339ca5a396acc588e5851ed7e19f66b0ebd9 (diff) |
soc/tegra: pmc: Fail to allocate more than one wake IRQ
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>
Diffstat (limited to 'drivers/soc')
-rw-r--r-- | drivers/soc/tegra/pmc.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/soc/tegra/pmc.c b/drivers/soc/tegra/pmc.c index 5648e5c09ef5..653fe2c466f6 100644 --- a/drivers/soc/tegra/pmc.c +++ b/drivers/soc/tegra/pmc.c @@ -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]; |