Hello. On 14-10-2013 17:21, Jayachandran C wrote:
Support for adding legacy IRQ domain for XLP9XX. The node id of the PIC has to be calulated differently for XLP9XX.
Signed-off-by: Jayachandran C <jchandra@xxxxxxxxxxxx> --- arch/mips/netlogic/common/irq.c | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-)
diff --git a/arch/mips/netlogic/common/irq.c b/arch/mips/netlogic/common/irq.c index 8092bb3..34be9bb 100644 --- a/arch/mips/netlogic/common/irq.c +++ b/arch/mips/netlogic/common/irq.c
[...]
@@ -293,7 +292,28 @@ static int __init xlp_of_pic_init(struct device_node *node, pr_err("PIC %s: reg property not found!\n", node->name); return -EINVAL; } - socid = (res.start >> 18) & 0x3; + + if (cpu_is_xlp9xx()) { + bus = (res.start >> 20) & 0xf; + for (socid = 0; socid < NLM_NR_NODES; socid++) { + if (!nlm_node_present(socid)) + continue; + if (nlm_get_node(socid)->socbus == bus) + break; + } + if (socid == NLM_NR_NODES) { + pr_err("PIC %s: Node mapping for bus %d not found!n", + node->name, bus); + return -EINVAL; + } + } else + socid = (res.start >> 18) & 0x3;
Both arms of the *if* statement should have {} if one arm has it, according to Documentation/CodingStyle.
WBR, Sergei