diff options
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/platforms/85xx/mpc85xx_cds.c | 36 |
1 files changed, 25 insertions, 11 deletions
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_cds.c b/arch/powerpc/platforms/85xx/mpc85xx_cds.c index e77c869d3916..2a41083aca3c 100644 --- a/arch/powerpc/platforms/85xx/mpc85xx_cds.c +++ b/arch/powerpc/platforms/85xx/mpc85xx_cds.c | |||
@@ -183,10 +183,6 @@ static void __init mpc85xx_cds_pic_init(void) | |||
183 | struct mpic *mpic; | 183 | struct mpic *mpic; |
184 | struct resource r; | 184 | struct resource r; |
185 | struct device_node *np = NULL; | 185 | struct device_node *np = NULL; |
186 | #if defined(CONFIG_PPC_I8259) && defined(CONFIG_PCI) | ||
187 | struct device_node *cascade_node = NULL; | ||
188 | int cascade_irq; | ||
189 | #endif | ||
190 | 186 | ||
191 | np = of_find_node_by_type(np, "open-pic"); | 187 | np = of_find_node_by_type(np, "open-pic"); |
192 | 188 | ||
@@ -210,8 +206,19 @@ static void __init mpc85xx_cds_pic_init(void) | |||
210 | of_node_put(np); | 206 | of_node_put(np); |
211 | 207 | ||
212 | mpic_init(mpic); | 208 | mpic_init(mpic); |
209 | } | ||
213 | 210 | ||
214 | #if defined(CONFIG_PPC_I8259) && defined(CONFIG_PCI) | 211 | #if defined(CONFIG_PPC_I8259) && defined(CONFIG_PCI) |
212 | static int mpc85xx_cds_8259_attach(void) | ||
213 | { | ||
214 | int ret; | ||
215 | struct device_node *np = NULL; | ||
216 | struct device_node *cascade_node = NULL; | ||
217 | int cascade_irq; | ||
218 | |||
219 | if (!machine_is(mpc85xx_cds)) | ||
220 | return 0; | ||
221 | |||
215 | /* Initialize the i8259 controller */ | 222 | /* Initialize the i8259 controller */ |
216 | for_each_node_by_type(np, "interrupt-controller") | 223 | for_each_node_by_type(np, "interrupt-controller") |
217 | if (of_device_is_compatible(np, "chrp,iic")) { | 224 | if (of_device_is_compatible(np, "chrp,iic")) { |
@@ -221,13 +228,13 @@ static void __init mpc85xx_cds_pic_init(void) | |||
221 | 228 | ||
222 | if (cascade_node == NULL) { | 229 | if (cascade_node == NULL) { |
223 | printk(KERN_DEBUG "Could not find i8259 PIC\n"); | 230 | printk(KERN_DEBUG "Could not find i8259 PIC\n"); |
224 | return; | 231 | return -ENODEV; |
225 | } | 232 | } |
226 | 233 | ||
227 | cascade_irq = irq_of_parse_and_map(cascade_node, 0); | 234 | cascade_irq = irq_of_parse_and_map(cascade_node, 0); |
228 | if (cascade_irq == NO_IRQ) { | 235 | if (cascade_irq == NO_IRQ) { |
229 | printk(KERN_ERR "Failed to map cascade interrupt\n"); | 236 | printk(KERN_ERR "Failed to map cascade interrupt\n"); |
230 | return; | 237 | return -ENXIO; |
231 | } | 238 | } |
232 | 239 | ||
233 | i8259_init(cascade_node, 0); | 240 | i8259_init(cascade_node, 0); |
@@ -239,14 +246,21 @@ static void __init mpc85xx_cds_pic_init(void) | |||
239 | * disabled when the last user of the shared IRQ line frees their | 246 | * disabled when the last user of the shared IRQ line frees their |
240 | * interrupt. | 247 | * interrupt. |
241 | */ | 248 | */ |
242 | if (setup_irq(cascade_irq, &mpc85xxcds_8259_irqaction)) | 249 | if ((ret = setup_irq(cascade_irq, &mpc85xxcds_8259_irqaction))) { |
243 | printk(KERN_ERR "Failed to setup cascade interrupt\n"); | 250 | printk(KERN_ERR "Failed to setup cascade interrupt\n"); |
244 | else | 251 | return ret; |
245 | /* Success. Connect our low-level cascade handler. */ | 252 | } |
246 | set_irq_handler(cascade_irq, mpc85xx_8259_cascade_handler); | 253 | |
247 | #endif /* CONFIG_PPC_I8259 */ | 254 | /* Success. Connect our low-level cascade handler. */ |
255 | set_irq_handler(cascade_irq, mpc85xx_8259_cascade_handler); | ||
256 | |||
257 | return 0; | ||
248 | } | 258 | } |
249 | 259 | ||
260 | device_initcall(mpc85xx_cds_8259_attach); | ||
261 | |||
262 | #endif /* CONFIG_PPC_I8259 */ | ||
263 | |||
250 | /* | 264 | /* |
251 | * Setup the architecture | 265 | * Setup the architecture |
252 | */ | 266 | */ |