[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190212103835.7768-31-brgl@bgdev.pl>
Date: Tue, 12 Feb 2019 11:38:28 +0100
From: Bartosz Golaszewski <brgl@...ev.pl>
To: Sekhar Nori <nsekhar@...com>, Kevin Hilman <khilman@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>,
Jason Cooper <jason@...edaemon.net>,
Marc Zyngier <marc.zyngier@....com>,
David Lechner <david@...hnology.com>
Cc: linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
Bartosz Golaszewski <bgolaszewski@...libre.com>
Subject: [PATCH v3 30/37] ARM: davinci: cp-intc: request the memory region before remapping it
From: Bartosz Golaszewski <bgolaszewski@...libre.com>
Add a missing call to request_mem_region() before calling ioremap() to
make sure it's not been requested by another user.
Signed-off-by: Bartosz Golaszewski <bgolaszewski@...libre.com>
---
arch/arm/mach-davinci/cp_intc.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/arch/arm/mach-davinci/cp_intc.c b/arch/arm/mach-davinci/cp_intc.c
index f56a4275083f..6ab56af3be6b 100644
--- a/arch/arm/mach-davinci/cp_intc.c
+++ b/arch/arm/mach-davinci/cp_intc.c
@@ -164,6 +164,15 @@ davinci_cp_intc_do_init(const struct davinci_cp_intc_config *config,
{
unsigned int num_regs = BITS_TO_LONGS(config->num_irqs);
int offset, irq_base;
+ void __iomem *req;
+
+ req = request_mem_region(config->reg.start,
+ resource_size(&config->reg),
+ "davinci-cp-intc");
+ if (!req) {
+ pr_err("%s: register range busy\n", __func__);
+ return -EBUSY;
+ }
davinci_cp_intc_base = ioremap(config->reg.start,
resource_size(&config->reg));
--
2.20.1
Powered by blists - more mailing lists