hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/irqchip/irq-nvic.c
....@@ -1,12 +1,9 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * drivers/irq/irq-nvic.c
34 *
45 * Copyright (C) 2008 ARM Limited, All Rights Reserved.
56 * Copyright (C) 2013 Pengutronix
6
- *
7
- * This program is free software; you can redistribute it and/or modify
8
- * it under the terms of the GNU General Public License version 2 as
9
- * published by the Free Software Foundation.
107 *
118 * Support for the Nested Vectored Interrupt Controller found on the
129 * ARMv7-M CPUs (Cortex-M3/M4)
....@@ -48,17 +45,6 @@
4845 handle_IRQ(irq, regs);
4946 }
5047
51
-static int nvic_irq_domain_translate(struct irq_domain *d,
52
- struct irq_fwspec *fwspec,
53
- unsigned long *hwirq, unsigned int *type)
54
-{
55
- if (WARN_ON(fwspec->param_count < 1))
56
- return -EINVAL;
57
- *hwirq = fwspec->param[0];
58
- *type = IRQ_TYPE_NONE;
59
- return 0;
60
-}
61
-
6248 static int nvic_irq_domain_alloc(struct irq_domain *domain, unsigned int virq,
6349 unsigned int nr_irqs, void *arg)
6450 {
....@@ -67,7 +53,7 @@
6753 unsigned int type = IRQ_TYPE_NONE;
6854 struct irq_fwspec *fwspec = arg;
6955
70
- ret = nvic_irq_domain_translate(domain, fwspec, &hwirq, &type);
56
+ ret = irq_domain_translate_onecell(domain, fwspec, &hwirq, &type);
7157 if (ret)
7258 return ret;
7359
....@@ -78,7 +64,7 @@
7864 }
7965
8066 static const struct irq_domain_ops nvic_irq_domain_ops = {
81
- .translate = nvic_irq_domain_translate,
67
+ .translate = irq_domain_translate_onecell,
8268 .alloc = nvic_irq_domain_alloc,
8369 .free = irq_domain_free_irqs_top,
8470 };
....@@ -108,6 +94,7 @@
10894
10995 if (!nvic_irq_domain) {
11096 pr_warn("Failed to allocate irq domain\n");
97
+ iounmap(nvic_base);
11198 return -ENOMEM;
11299 }
113100
....@@ -117,6 +104,7 @@
117104 if (ret) {
118105 pr_warn("Failed to allocate irq chips\n");
119106 irq_domain_remove(nvic_irq_domain);
107
+ iounmap(nvic_base);
120108 return ret;
121109 }
122110