diff options
Diffstat (limited to 'arch/powerpc/sysdev/mpc8xx_pic.c')
-rw-r--r-- | arch/powerpc/sysdev/mpc8xx_pic.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/arch/powerpc/sysdev/mpc8xx_pic.c b/arch/powerpc/sysdev/mpc8xx_pic.c index 2fc2bcd79b5e..f20a4d43d104 100644 --- a/arch/powerpc/sysdev/mpc8xx_pic.c +++ b/arch/powerpc/sysdev/mpc8xx_pic.c | |||
@@ -19,7 +19,6 @@ | |||
19 | 19 | ||
20 | extern int cpm_get_irq(struct pt_regs *regs); | 20 | extern int cpm_get_irq(struct pt_regs *regs); |
21 | 21 | ||
22 | static struct device_node *mpc8xx_pic_node; | ||
23 | static struct irq_host *mpc8xx_pic_host; | 22 | static struct irq_host *mpc8xx_pic_host; |
24 | #define NR_MASK_WORDS ((NR_IRQS + 31) / 32) | 23 | #define NR_MASK_WORDS ((NR_IRQS + 31) / 32) |
25 | static unsigned long ppc_cached_irq_mask[NR_MASK_WORDS]; | 24 | static unsigned long ppc_cached_irq_mask[NR_MASK_WORDS]; |
@@ -122,7 +121,7 @@ unsigned int mpc8xx_get_irq(void) | |||
122 | 121 | ||
123 | static int mpc8xx_pic_host_match(struct irq_host *h, struct device_node *node) | 122 | static int mpc8xx_pic_host_match(struct irq_host *h, struct device_node *node) |
124 | { | 123 | { |
125 | return mpc8xx_pic_node == node; | 124 | return h->of_node == node; |
126 | } | 125 | } |
127 | 126 | ||
128 | static int mpc8xx_pic_host_map(struct irq_host *h, unsigned int virq, | 127 | static int mpc8xx_pic_host_map(struct irq_host *h, unsigned int virq, |
@@ -176,22 +175,24 @@ int mpc8xx_pic_init(void) | |||
176 | return -ENOMEM; | 175 | return -ENOMEM; |
177 | } | 176 | } |
178 | 177 | ||
179 | mpc8xx_pic_node = of_node_get(np); | ||
180 | |||
181 | ret = of_address_to_resource(np, 0, &res); | 178 | ret = of_address_to_resource(np, 0, &res); |
182 | of_node_put(np); | ||
183 | if (ret) | 179 | if (ret) |
184 | return ret; | 180 | goto out; |
185 | 181 | ||
186 | siu_reg = (void *)ioremap(res.start, res.end - res.start + 1); | 182 | siu_reg = (void *)ioremap(res.start, res.end - res.start + 1); |
187 | if (siu_reg == NULL) | 183 | if (siu_reg == NULL) { |
188 | return -EINVAL; | 184 | ret = -EINVAL; |
185 | goto out; | ||
186 | } | ||
189 | 187 | ||
190 | mpc8xx_pic_host = irq_alloc_host(IRQ_HOST_MAP_LINEAR, 64, &mpc8xx_pic_host_ops, 64); | 188 | mpc8xx_pic_host = irq_alloc_host(of_node_get(np), IRQ_HOST_MAP_LINEAR, |
189 | 64, &mpc8xx_pic_host_ops, 64); | ||
191 | if (mpc8xx_pic_host == NULL) { | 190 | if (mpc8xx_pic_host == NULL) { |
192 | printk(KERN_ERR "MPC8xx PIC: failed to allocate irq host!\n"); | 191 | printk(KERN_ERR "MPC8xx PIC: failed to allocate irq host!\n"); |
193 | ret = -ENOMEM; | 192 | ret = -ENOMEM; |
194 | } | 193 | } |
195 | 194 | ||
195 | out: | ||
196 | of_node_put(np); | ||
196 | return ret; | 197 | return ret; |
197 | } | 198 | } |