ARM: 7611/1: VIC: fix bug in VIC irqdomain code

The VIC irqdomain code added in commit
07c9249f1fa90cc8189bed44c0bcece664596a72
"ARM: 7554/1: VIC: use irq_domain_add_simple()"

Had two bugs:

1) It didn't call irq_create_mapping() once on each
valid irq source in the slowpath when registering
the controller.

2) It passed a -1 as IRQ offset for the DT case, whereas
0 should be passed as invalid IRQ instead.

Cc: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

authored by Linus Walleij and committed by Russell King 5ced33bc f5565295

+7 -2
+7 -2
arch/arm/common/vic.c
··· 206 206 struct device_node *node) 207 207 { 208 208 struct vic_device *v; 209 + int i; 209 210 210 211 if (vic_id >= ARRAY_SIZE(vic_devices)) { 211 212 printk(KERN_ERR "%s: too few VICs, increase CONFIG_ARM_VIC_NR\n", __func__); ··· 221 220 vic_id++; 222 221 v->domain = irq_domain_add_simple(node, fls(valid_sources), irq, 223 222 &vic_irqdomain_ops, v); 223 + /* create an IRQ mapping for each valid IRQ */ 224 + for (i = 0; i < fls(valid_sources); i++) 225 + if (valid_sources & (1 << i)) 226 + irq_create_mapping(v->domain, i); 224 227 } 225 228 226 229 static void vic_ack_irq(struct irq_data *d) ··· 421 416 return -EIO; 422 417 423 418 /* 424 - * Passing -1 as first IRQ makes the simple domain allocate descriptors 419 + * Passing 0 as first IRQ makes the simple domain allocate descriptors 425 420 */ 426 - __vic_init(regs, -1, ~0, ~0, node); 421 + __vic_init(regs, 0, ~0, ~0, node); 427 422 428 423 return 0; 429 424 }