aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/sysdev/mpic.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/sysdev/mpic.c')
-rw-r--r--arch/powerpc/sysdev/mpic.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c
index 6c90c95b454e..8e3478c995ef 100644
--- a/arch/powerpc/sysdev/mpic.c
+++ b/arch/powerpc/sysdev/mpic.c
@@ -1016,13 +1016,11 @@ struct mpic * __init mpic_alloc(struct device_node *node,
1016 memset(mpic, 0, sizeof(struct mpic)); 1016 memset(mpic, 0, sizeof(struct mpic));
1017 mpic->name = name; 1017 mpic->name = name;
1018 1018
1019 mpic->irqhost = irq_alloc_host(of_node_get(node), IRQ_HOST_MAP_LINEAR, 1019 mpic->irqhost = irq_alloc_host(node, IRQ_HOST_MAP_LINEAR,
1020 isu_size, &mpic_host_ops, 1020 isu_size, &mpic_host_ops,
1021 flags & MPIC_LARGE_VECTORS ? 2048 : 256); 1021 flags & MPIC_LARGE_VECTORS ? 2048 : 256);
1022 if (mpic->irqhost == NULL) { 1022 if (mpic->irqhost == NULL)
1023 of_node_put(node);
1024 return NULL; 1023 return NULL;
1025 }
1026 1024
1027 mpic->irqhost->host_data = mpic; 1025 mpic->irqhost->host_data = mpic;
1028 mpic->hc_irq = mpic_irq_chip; 1026 mpic->hc_irq = mpic_irq_chip;
@@ -1143,10 +1141,14 @@ struct mpic * __init mpic_alloc(struct device_node *node,
1143 greg_feature = mpic_read(mpic->gregs, MPIC_INFO(GREG_FEATURE_0)); 1141 greg_feature = mpic_read(mpic->gregs, MPIC_INFO(GREG_FEATURE_0));
1144 mpic->num_cpus = ((greg_feature & MPIC_GREG_FEATURE_LAST_CPU_MASK) 1142 mpic->num_cpus = ((greg_feature & MPIC_GREG_FEATURE_LAST_CPU_MASK)
1145 >> MPIC_GREG_FEATURE_LAST_CPU_SHIFT) + 1; 1143 >> MPIC_GREG_FEATURE_LAST_CPU_SHIFT) + 1;
1146 if (isu_size == 0) 1144 if (isu_size == 0) {
1147 mpic->num_sources = 1145 if (flags & MPIC_BROKEN_FRR_NIRQS)
1148 ((greg_feature & MPIC_GREG_FEATURE_LAST_SRC_MASK) 1146 mpic->num_sources = mpic->irq_count;
1149 >> MPIC_GREG_FEATURE_LAST_SRC_SHIFT) + 1; 1147 else
1148 mpic->num_sources =
1149 ((greg_feature & MPIC_GREG_FEATURE_LAST_SRC_MASK)
1150 >> MPIC_GREG_FEATURE_LAST_SRC_SHIFT) + 1;
1151 }
1150 1152
1151 /* Map the per-CPU registers */ 1153 /* Map the per-CPU registers */
1152 for (i = 0; i < mpic->num_cpus; i++) { 1154 for (i = 0; i < mpic->num_cpus; i++) {