aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/irqchip
diff options
context:
space:
mode:
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>2013-08-09 16:27:10 -0400
committerJason Cooper <jason@lakedaemon.net>2013-09-30 10:58:07 -0400
commit627dfcc249e2eae07982272808ad560592e730e0 (patch)
tree1df9284d3a54445daa0083c0d5ac4de12b173026 /drivers/irqchip
parent272b98c6455f00884f0350f775c5342358ebb73f (diff)
irqchip: armada-370-xp: properly request resources
Instead of using of_iomap(), we now use of_address_to_resource(), request_mem_region() and ioremap(). This allows the corresponding I/O regions to be properly requested and visible in /proc/iomem. The main motivation for this change is that the introduction of the MSI support requires us to get the physical address of the main interrupt controller registers, so we will need the corresponding 'struct resource' anyway. We also take this opportunity to change a panic() to BUG_ON(), in order to be consistent with the rest of the driver. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Tested-by: Daniel Price <daniel.price@gmail.com> Acked-by: Gregory CLEMENT <gregory.clement@free-electrons.com> Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Diffstat (limited to 'drivers/irqchip')
-rw-r--r--drivers/irqchip/irq-armada-370-xp.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/drivers/irqchip/irq-armada-370-xp.c b/drivers/irqchip/irq-armada-370-xp.c
index bb328a366122..26adc741f764 100644
--- a/drivers/irqchip/irq-armada-370-xp.c
+++ b/drivers/irqchip/irq-armada-370-xp.c
@@ -248,12 +248,25 @@ armada_370_xp_handle_irq(struct pt_regs *regs)
248static int __init armada_370_xp_mpic_of_init(struct device_node *node, 248static int __init armada_370_xp_mpic_of_init(struct device_node *node,
249 struct device_node *parent) 249 struct device_node *parent)
250{ 250{
251 struct resource main_int_res, per_cpu_int_res;
251 u32 control; 252 u32 control;
252 253
253 main_int_base = of_iomap(node, 0); 254 BUG_ON(of_address_to_resource(node, 0, &main_int_res));
254 per_cpu_int_base = of_iomap(node, 1); 255 BUG_ON(of_address_to_resource(node, 1, &per_cpu_int_res));
255 256
257 BUG_ON(!request_mem_region(main_int_res.start,
258 resource_size(&main_int_res),
259 node->full_name));
260 BUG_ON(!request_mem_region(per_cpu_int_res.start,
261 resource_size(&per_cpu_int_res),
262 node->full_name));
263
264 main_int_base = ioremap(main_int_res.start,
265 resource_size(&main_int_res));
256 BUG_ON(!main_int_base); 266 BUG_ON(!main_int_base);
267
268 per_cpu_int_base = ioremap(per_cpu_int_res.start,
269 resource_size(&per_cpu_int_res));
257 BUG_ON(!per_cpu_int_base); 270 BUG_ON(!per_cpu_int_base);
258 271
259 control = readl(main_int_base + ARMADA_370_XP_INT_CONTROL); 272 control = readl(main_int_base + ARMADA_370_XP_INT_CONTROL);
@@ -262,8 +275,7 @@ static int __init armada_370_xp_mpic_of_init(struct device_node *node,
262 irq_domain_add_linear(node, (control >> 2) & 0x3ff, 275 irq_domain_add_linear(node, (control >> 2) & 0x3ff,
263 &armada_370_xp_mpic_irq_ops, NULL); 276 &armada_370_xp_mpic_irq_ops, NULL);
264 277
265 if (!armada_370_xp_mpic_domain) 278 BUG_ON(!armada_370_xp_mpic_domain);
266 panic("Unable to add Armada_370_Xp MPIC irq domain (DT)\n");
267 279
268 irq_set_default_host(armada_370_xp_mpic_domain); 280 irq_set_default_host(armada_370_xp_mpic_domain);
269 281