diff options
author | Michael Ellerman <michael@ellerman.id.au> | 2007-08-28 04:47:54 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-09-13 11:33:20 -0400 |
commit | 52964f87c64e6c6ea671b5bf3030fb1494090a48 (patch) | |
tree | 2e20d81bc05b60b7108733daf5713ea640ad2477 /arch/powerpc | |
parent | 0ae0b54565a8dcc2b98de694b998e765de15b713 (diff) |
[POWERPC] Add an optional device_node pointer to the irq_host
The majority of irq_host implementations (3 out of 4) are associated
with a device_node, and need to stash it somewhere. Rather than having
it somewhere different for each host, add an optional device_node pointer
to the irq_host structure.
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc')
24 files changed, 70 insertions, 104 deletions
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c index dfad0e469eec..79b451247b89 100644 --- a/arch/powerpc/kernel/irq.c +++ b/arch/powerpc/kernel/irq.c | |||
@@ -418,10 +418,11 @@ irq_hw_number_t virq_to_hw(unsigned int virq) | |||
418 | } | 418 | } |
419 | EXPORT_SYMBOL_GPL(virq_to_hw); | 419 | EXPORT_SYMBOL_GPL(virq_to_hw); |
420 | 420 | ||
421 | __init_refok struct irq_host *irq_alloc_host(unsigned int revmap_type, | 421 | __init_refok struct irq_host *irq_alloc_host(struct device_node *of_node, |
422 | unsigned int revmap_arg, | 422 | unsigned int revmap_type, |
423 | struct irq_host_ops *ops, | 423 | unsigned int revmap_arg, |
424 | irq_hw_number_t inval_irq) | 424 | struct irq_host_ops *ops, |
425 | irq_hw_number_t inval_irq) | ||
425 | { | 426 | { |
426 | struct irq_host *host; | 427 | struct irq_host *host; |
427 | unsigned int size = sizeof(struct irq_host); | 428 | unsigned int size = sizeof(struct irq_host); |
@@ -446,6 +447,7 @@ __init_refok struct irq_host *irq_alloc_host(unsigned int revmap_type, | |||
446 | host->revmap_type = revmap_type; | 447 | host->revmap_type = revmap_type; |
447 | host->inval_irq = inval_irq; | 448 | host->inval_irq = inval_irq; |
448 | host->ops = ops; | 449 | host->ops = ops; |
450 | host->of_node = of_node; | ||
449 | 451 | ||
450 | spin_lock_irqsave(&irq_big_lock, flags); | 452 | spin_lock_irqsave(&irq_big_lock, flags); |
451 | 453 | ||
diff --git a/arch/powerpc/platforms/52xx/mpc52xx_pic.c b/arch/powerpc/platforms/52xx/mpc52xx_pic.c index 8c464c55b5d0..1d793e4b8d56 100644 --- a/arch/powerpc/platforms/52xx/mpc52xx_pic.c +++ b/arch/powerpc/platforms/52xx/mpc52xx_pic.c | |||
@@ -244,7 +244,7 @@ static struct irq_chip mpc52xx_sdma_irqchip = { | |||
244 | static int mpc52xx_irqhost_match(struct irq_host *h, struct device_node *node) | 244 | static int mpc52xx_irqhost_match(struct irq_host *h, struct device_node *node) |
245 | { | 245 | { |
246 | pr_debug("%s: node=%p\n", __func__, node); | 246 | pr_debug("%s: node=%p\n", __func__, node); |
247 | return mpc52xx_irqhost->host_data == node; | 247 | return h->of_node == node; |
248 | } | 248 | } |
249 | 249 | ||
250 | static int mpc52xx_irqhost_xlate(struct irq_host *h, struct device_node *ct, | 250 | static int mpc52xx_irqhost_xlate(struct irq_host *h, struct device_node *ct, |
@@ -419,14 +419,13 @@ void __init mpc52xx_init_irq(void) | |||
419 | * hw irq information provided by the ofw to linux virq | 419 | * hw irq information provided by the ofw to linux virq |
420 | */ | 420 | */ |
421 | 421 | ||
422 | mpc52xx_irqhost = irq_alloc_host(IRQ_HOST_MAP_LINEAR, | 422 | mpc52xx_irqhost = irq_alloc_host(picnode, IRQ_HOST_MAP_LINEAR, |
423 | MPC52xx_IRQ_HIGHTESTHWIRQ, | 423 | MPC52xx_IRQ_HIGHTESTHWIRQ, |
424 | &mpc52xx_irqhost_ops, -1); | 424 | &mpc52xx_irqhost_ops, -1); |
425 | 425 | ||
426 | if (!mpc52xx_irqhost) | 426 | if (!mpc52xx_irqhost) |
427 | panic(__FILE__ ": Cannot allocate the IRQ host\n"); | 427 | panic(__FILE__ ": Cannot allocate the IRQ host\n"); |
428 | 428 | ||
429 | mpc52xx_irqhost->host_data = picnode; | ||
430 | printk(KERN_INFO "MPC52xx PIC is up and running!\n"); | 429 | printk(KERN_INFO "MPC52xx PIC is up and running!\n"); |
431 | } | 430 | } |
432 | 431 | ||
diff --git a/arch/powerpc/platforms/82xx/mpc82xx_ads.c b/arch/powerpc/platforms/82xx/mpc82xx_ads.c index c0a0c56ac5b3..91ddbd2f477d 100644 --- a/arch/powerpc/platforms/82xx/mpc82xx_ads.c +++ b/arch/powerpc/platforms/82xx/mpc82xx_ads.c | |||
@@ -61,7 +61,6 @@ static struct { | |||
61 | 61 | ||
62 | static unsigned long pci_int_base; | 62 | static unsigned long pci_int_base; |
63 | static struct irq_host *pci_pic_host; | 63 | static struct irq_host *pci_pic_host; |
64 | static struct device_node *pci_pic_node; | ||
65 | #endif | 64 | #endif |
66 | 65 | ||
67 | static void __init mpc82xx_ads_pic_init(void) | 66 | static void __init mpc82xx_ads_pic_init(void) |
@@ -401,7 +400,7 @@ m82xx_pci_irq_demux(unsigned int irq, struct irq_desc *desc) | |||
401 | 400 | ||
402 | static int pci_pic_host_match(struct irq_host *h, struct device_node *node) | 401 | static int pci_pic_host_match(struct irq_host *h, struct device_node *node) |
403 | { | 402 | { |
404 | return node == pci_pic_node; | 403 | return h->of_node == node; |
405 | } | 404 | } |
406 | 405 | ||
407 | static int pci_pic_host_map(struct irq_host *h, unsigned int virq, | 406 | static int pci_pic_host_map(struct irq_host *h, unsigned int virq, |
@@ -478,7 +477,6 @@ void m82xx_pci_init_irq(void) | |||
478 | iounmap(immap); | 477 | iounmap(immap); |
479 | return; | 478 | return; |
480 | } | 479 | } |
481 | pci_pic_node = of_node_get(np); | ||
482 | /* PCI interrupt controller registers: status and mask */ | 480 | /* PCI interrupt controller registers: status and mask */ |
483 | regs = of_get_property(np, "reg", &size); | 481 | regs = of_get_property(np, "reg", &size); |
484 | if ((!regs) || (size <= 2)) { | 482 | if ((!regs) || (size <= 2)) { |
@@ -490,7 +488,6 @@ void m82xx_pci_init_irq(void) | |||
490 | ioremap(regs[0], sizeof(*pci_regs.pci_int_stat_reg)); | 488 | ioremap(regs[0], sizeof(*pci_regs.pci_int_stat_reg)); |
491 | pci_regs.pci_int_mask_reg = | 489 | pci_regs.pci_int_mask_reg = |
492 | ioremap(regs[1], sizeof(*pci_regs.pci_int_mask_reg)); | 490 | ioremap(regs[1], sizeof(*pci_regs.pci_int_mask_reg)); |
493 | of_node_put(np); | ||
494 | /* configure chip select for PCI interrupt controller */ | 491 | /* configure chip select for PCI interrupt controller */ |
495 | immap->im_memctl.memc_br3 = regs[0] | 0x00001801; | 492 | immap->im_memctl.memc_br3 = regs[0] | 0x00001801; |
496 | immap->im_memctl.memc_or3 = 0xffff8010; | 493 | immap->im_memctl.memc_or3 = 0xffff8010; |
@@ -501,7 +498,7 @@ void m82xx_pci_init_irq(void) | |||
501 | *pci_regs.pci_int_mask_reg |= 0xfff00000; | 498 | *pci_regs.pci_int_mask_reg |= 0xfff00000; |
502 | iounmap(immap); | 499 | iounmap(immap); |
503 | pci_pic_host = | 500 | pci_pic_host = |
504 | irq_alloc_host(IRQ_HOST_MAP_LINEAR, irq_max - irq_min + 1, | 501 | irq_alloc_host(np, IRQ_HOST_MAP_LINEAR, irq_max - irq_min + 1, |
505 | &pci_pic_host_ops, irq_max + 1); | 502 | &pci_pic_host_ops, irq_max + 1); |
506 | return; | 503 | return; |
507 | } | 504 | } |
diff --git a/arch/powerpc/platforms/cell/axon_msi.c b/arch/powerpc/platforms/cell/axon_msi.c index 4c9ab5b70bae..bdd97bb2446d 100644 --- a/arch/powerpc/platforms/cell/axon_msi.c +++ b/arch/powerpc/platforms/cell/axon_msi.c | |||
@@ -64,7 +64,6 @@ | |||
64 | 64 | ||
65 | 65 | ||
66 | struct axon_msic { | 66 | struct axon_msic { |
67 | struct device_node *dn; | ||
68 | struct irq_host *irq_host; | 67 | struct irq_host *irq_host; |
69 | __le32 *fifo; | 68 | __le32 *fifo; |
70 | dcr_host_t dcr_host; | 69 | dcr_host_t dcr_host; |
@@ -297,9 +296,7 @@ static int msic_host_map(struct irq_host *h, unsigned int virq, | |||
297 | 296 | ||
298 | static int msic_host_match(struct irq_host *host, struct device_node *dn) | 297 | static int msic_host_match(struct irq_host *host, struct device_node *dn) |
299 | { | 298 | { |
300 | struct axon_msic *msic = host->host_data; | 299 | return host->of_node == dn; |
301 | |||
302 | return msic->dn == dn; | ||
303 | } | 300 | } |
304 | 301 | ||
305 | static struct irq_host_ops msic_host_ops = { | 302 | static struct irq_host_ops msic_host_ops = { |
@@ -314,7 +311,8 @@ static int axon_msi_notify_reboot(struct notifier_block *nb, | |||
314 | u32 tmp; | 311 | u32 tmp; |
315 | 312 | ||
316 | list_for_each_entry(msic, &axon_msic_list, list) { | 313 | list_for_each_entry(msic, &axon_msic_list, list) { |
317 | pr_debug("axon_msi: disabling %s\n", msic->dn->full_name); | 314 | pr_debug("axon_msi: disabling %s\n", |
315 | msic->irq_host->of_node->full_name); | ||
318 | tmp = msic_dcr_read(msic, MSIC_CTRL_REG); | 316 | tmp = msic_dcr_read(msic, MSIC_CTRL_REG); |
319 | tmp &= ~MSIC_CTRL_ENABLE & ~MSIC_CTRL_IRQ_ENABLE; | 317 | tmp &= ~MSIC_CTRL_ENABLE & ~MSIC_CTRL_IRQ_ENABLE; |
320 | msic_dcr_write(msic, MSIC_CTRL_REG, tmp); | 318 | msic_dcr_write(msic, MSIC_CTRL_REG, tmp); |
@@ -370,8 +368,8 @@ static int axon_msi_setup_one(struct device_node *dn) | |||
370 | 368 | ||
371 | msic->fifo = page_address(page); | 369 | msic->fifo = page_address(page); |
372 | 370 | ||
373 | msic->irq_host = irq_alloc_host(IRQ_HOST_MAP_NOMAP, NR_IRQS, | 371 | msic->irq_host = irq_alloc_host(of_node_get(dn), IRQ_HOST_MAP_NOMAP, |
374 | &msic_host_ops, 0); | 372 | NR_IRQS, &msic_host_ops, 0); |
375 | if (!msic->irq_host) { | 373 | if (!msic->irq_host) { |
376 | printk(KERN_ERR "axon_msi: couldn't allocate irq_host for %s\n", | 374 | printk(KERN_ERR "axon_msi: couldn't allocate irq_host for %s\n", |
377 | dn->full_name); | 375 | dn->full_name); |
@@ -387,8 +385,6 @@ static int axon_msi_setup_one(struct device_node *dn) | |||
387 | goto out_free_host; | 385 | goto out_free_host; |
388 | } | 386 | } |
389 | 387 | ||
390 | msic->dn = of_node_get(dn); | ||
391 | |||
392 | set_irq_data(virq, msic); | 388 | set_irq_data(virq, msic); |
393 | set_irq_chained_handler(virq, axon_msi_cascade); | 389 | set_irq_chained_handler(virq, axon_msi_cascade); |
394 | pr_debug("axon_msi: irq 0x%x setup for axon_msi\n", virq); | 390 | pr_debug("axon_msi: irq 0x%x setup for axon_msi\n", virq); |
diff --git a/arch/powerpc/platforms/cell/interrupt.c b/arch/powerpc/platforms/cell/interrupt.c index 47264e722029..c29e634177fa 100644 --- a/arch/powerpc/platforms/cell/interrupt.c +++ b/arch/powerpc/platforms/cell/interrupt.c | |||
@@ -381,7 +381,7 @@ static int __init setup_iic(void) | |||
381 | void __init iic_init_IRQ(void) | 381 | void __init iic_init_IRQ(void) |
382 | { | 382 | { |
383 | /* Setup an irq host data structure */ | 383 | /* Setup an irq host data structure */ |
384 | iic_host = irq_alloc_host(IRQ_HOST_MAP_LINEAR, IIC_SOURCE_COUNT, | 384 | iic_host = irq_alloc_host(NULL, IRQ_HOST_MAP_LINEAR, IIC_SOURCE_COUNT, |
385 | &iic_host_ops, IIC_IRQ_INVALID); | 385 | &iic_host_ops, IIC_IRQ_INVALID); |
386 | BUG_ON(iic_host == NULL); | 386 | BUG_ON(iic_host == NULL); |
387 | irq_set_default_host(iic_host); | 387 | irq_set_default_host(iic_host); |
diff --git a/arch/powerpc/platforms/cell/spider-pic.c b/arch/powerpc/platforms/cell/spider-pic.c index 05f4b3d3d756..4309c2cbbeb9 100644 --- a/arch/powerpc/platforms/cell/spider-pic.c +++ b/arch/powerpc/platforms/cell/spider-pic.c | |||
@@ -63,7 +63,6 @@ enum { | |||
63 | 63 | ||
64 | struct spider_pic { | 64 | struct spider_pic { |
65 | struct irq_host *host; | 65 | struct irq_host *host; |
66 | struct device_node *of_node; | ||
67 | void __iomem *regs; | 66 | void __iomem *regs; |
68 | unsigned int node_id; | 67 | unsigned int node_id; |
69 | }; | 68 | }; |
@@ -178,8 +177,7 @@ static struct irq_chip spider_pic = { | |||
178 | 177 | ||
179 | static int spider_host_match(struct irq_host *h, struct device_node *node) | 178 | static int spider_host_match(struct irq_host *h, struct device_node *node) |
180 | { | 179 | { |
181 | struct spider_pic *pic = h->host_data; | 180 | return h->of_node == node; |
182 | return node == pic->of_node; | ||
183 | } | 181 | } |
184 | 182 | ||
185 | static int spider_host_map(struct irq_host *h, unsigned int virq, | 183 | static int spider_host_map(struct irq_host *h, unsigned int virq, |
@@ -247,18 +245,18 @@ static unsigned int __init spider_find_cascade_and_node(struct spider_pic *pic) | |||
247 | * tree in case the device-tree is ever fixed | 245 | * tree in case the device-tree is ever fixed |
248 | */ | 246 | */ |
249 | struct of_irq oirq; | 247 | struct of_irq oirq; |
250 | if (of_irq_map_one(pic->of_node, 0, &oirq) == 0) { | 248 | if (of_irq_map_one(pic->host->of_node, 0, &oirq) == 0) { |
251 | virq = irq_create_of_mapping(oirq.controller, oirq.specifier, | 249 | virq = irq_create_of_mapping(oirq.controller, oirq.specifier, |
252 | oirq.size); | 250 | oirq.size); |
253 | return virq; | 251 | return virq; |
254 | } | 252 | } |
255 | 253 | ||
256 | /* Now do the horrible hacks */ | 254 | /* Now do the horrible hacks */ |
257 | tmp = of_get_property(pic->of_node, "#interrupt-cells", NULL); | 255 | tmp = of_get_property(pic->host->of_node, "#interrupt-cells", NULL); |
258 | if (tmp == NULL) | 256 | if (tmp == NULL) |
259 | return NO_IRQ; | 257 | return NO_IRQ; |
260 | intsize = *tmp; | 258 | intsize = *tmp; |
261 | imap = of_get_property(pic->of_node, "interrupt-map", &imaplen); | 259 | imap = of_get_property(pic->host->of_node, "interrupt-map", &imaplen); |
262 | if (imap == NULL || imaplen < (intsize + 1)) | 260 | if (imap == NULL || imaplen < (intsize + 1)) |
263 | return NO_IRQ; | 261 | return NO_IRQ; |
264 | iic = of_find_node_by_phandle(imap[intsize]); | 262 | iic = of_find_node_by_phandle(imap[intsize]); |
@@ -308,15 +306,13 @@ static void __init spider_init_one(struct device_node *of_node, int chip, | |||
308 | panic("spider_pic: can't map registers !"); | 306 | panic("spider_pic: can't map registers !"); |
309 | 307 | ||
310 | /* Allocate a host */ | 308 | /* Allocate a host */ |
311 | pic->host = irq_alloc_host(IRQ_HOST_MAP_LINEAR, SPIDER_SRC_COUNT, | 309 | pic->host = irq_alloc_host(of_node_get(of_node), IRQ_HOST_MAP_LINEAR, |
312 | &spider_host_ops, SPIDER_IRQ_INVALID); | 310 | SPIDER_SRC_COUNT, &spider_host_ops, |
311 | SPIDER_IRQ_INVALID); | ||
313 | if (pic->host == NULL) | 312 | if (pic->host == NULL) |
314 | panic("spider_pic: can't allocate irq host !"); | 313 | panic("spider_pic: can't allocate irq host !"); |
315 | pic->host->host_data = pic; | 314 | pic->host->host_data = pic; |
316 | 315 | ||
317 | /* Fill out other bits */ | ||
318 | pic->of_node = of_node_get(of_node); | ||
319 | |||
320 | /* Go through all sources and disable them */ | 316 | /* Go through all sources and disable them */ |
321 | for (i = 0; i < SPIDER_SRC_COUNT; i++) { | 317 | for (i = 0; i < SPIDER_SRC_COUNT; i++) { |
322 | void __iomem *cfg = pic->regs + TIR_CFGA + 8 * i; | 318 | void __iomem *cfg = pic->regs + TIR_CFGA + 8 * i; |
diff --git a/arch/powerpc/platforms/celleb/interrupt.c b/arch/powerpc/platforms/celleb/interrupt.c index 98e6665681d3..4ecdf06e421b 100644 --- a/arch/powerpc/platforms/celleb/interrupt.c +++ b/arch/powerpc/platforms/celleb/interrupt.c | |||
@@ -242,7 +242,7 @@ void __init beatic_init_IRQ(void) | |||
242 | ppc_md.get_irq = beatic_get_irq; | 242 | ppc_md.get_irq = beatic_get_irq; |
243 | 243 | ||
244 | /* Allocate an irq host */ | 244 | /* Allocate an irq host */ |
245 | beatic_host = irq_alloc_host(IRQ_HOST_MAP_NOMAP, 0, | 245 | beatic_host = irq_alloc_host(NULL, IRQ_HOST_MAP_NOMAP, 0, |
246 | &beatic_pic_host_ops, | 246 | &beatic_pic_host_ops, |
247 | 0); | 247 | 0); |
248 | BUG_ON(beatic_host == NULL); | 248 | BUG_ON(beatic_host == NULL); |
diff --git a/arch/powerpc/platforms/iseries/irq.c b/arch/powerpc/platforms/iseries/irq.c index 63b33675848b..36667460c922 100644 --- a/arch/powerpc/platforms/iseries/irq.c +++ b/arch/powerpc/platforms/iseries/irq.c | |||
@@ -369,7 +369,8 @@ void __init iSeries_init_IRQ(void) | |||
369 | /* Create irq host. No need for a revmap since HV will give us | 369 | /* Create irq host. No need for a revmap since HV will give us |
370 | * back our virtual irq number | 370 | * back our virtual irq number |
371 | */ | 371 | */ |
372 | host = irq_alloc_host(IRQ_HOST_MAP_NOMAP, 0, &iseries_irq_host_ops, 0); | 372 | host = irq_alloc_host(NULL, IRQ_HOST_MAP_NOMAP, 0, |
373 | &iseries_irq_host_ops, 0); | ||
373 | BUG_ON(host == NULL); | 374 | BUG_ON(host == NULL); |
374 | irq_set_default_host(host); | 375 | irq_set_default_host(host); |
375 | 376 | ||
diff --git a/arch/powerpc/platforms/powermac/pic.c b/arch/powerpc/platforms/powermac/pic.c index 87cd6805171a..999f5e160897 100644 --- a/arch/powerpc/platforms/powermac/pic.c +++ b/arch/powerpc/platforms/powermac/pic.c | |||
@@ -384,7 +384,7 @@ static void __init pmac_pic_probe_oldstyle(void) | |||
384 | /* | 384 | /* |
385 | * Allocate an irq host | 385 | * Allocate an irq host |
386 | */ | 386 | */ |
387 | pmac_pic_host = irq_alloc_host(IRQ_HOST_MAP_LINEAR, max_irqs, | 387 | pmac_pic_host = irq_alloc_host(master, IRQ_HOST_MAP_LINEAR, max_irqs, |
388 | &pmac_pic_host_ops, | 388 | &pmac_pic_host_ops, |
389 | max_irqs); | 389 | max_irqs); |
390 | BUG_ON(pmac_pic_host == NULL); | 390 | BUG_ON(pmac_pic_host == NULL); |
diff --git a/arch/powerpc/platforms/ps3/interrupt.c b/arch/powerpc/platforms/ps3/interrupt.c index 67e32ec9b37e..30b9f4c6eb55 100644 --- a/arch/powerpc/platforms/ps3/interrupt.c +++ b/arch/powerpc/platforms/ps3/interrupt.c | |||
@@ -726,7 +726,7 @@ void __init ps3_init_IRQ(void) | |||
726 | unsigned cpu; | 726 | unsigned cpu; |
727 | struct irq_host *host; | 727 | struct irq_host *host; |
728 | 728 | ||
729 | host = irq_alloc_host(IRQ_HOST_MAP_NOMAP, 0, &ps3_host_ops, | 729 | host = irq_alloc_host(NULL, IRQ_HOST_MAP_NOMAP, 0, &ps3_host_ops, |
730 | PS3_INVALID_OUTLET); | 730 | PS3_INVALID_OUTLET); |
731 | irq_set_default_host(host); | 731 | irq_set_default_host(host); |
732 | irq_set_virq_count(PS3_PLUG_MAX + 1); | 732 | irq_set_virq_count(PS3_PLUG_MAX + 1); |
diff --git a/arch/powerpc/platforms/pseries/xics.c b/arch/powerpc/platforms/pseries/xics.c index 5bd90a7eb763..5ddb0259b1fb 100644 --- a/arch/powerpc/platforms/pseries/xics.c +++ b/arch/powerpc/platforms/pseries/xics.c | |||
@@ -540,7 +540,7 @@ static void __init xics_init_host(void) | |||
540 | ops = &xics_host_lpar_ops; | 540 | ops = &xics_host_lpar_ops; |
541 | else | 541 | else |
542 | ops = &xics_host_direct_ops; | 542 | ops = &xics_host_direct_ops; |
543 | xics_host = irq_alloc_host(IRQ_HOST_MAP_TREE, 0, ops, | 543 | xics_host = irq_alloc_host(NULL, IRQ_HOST_MAP_TREE, 0, ops, |
544 | XICS_IRQ_SPURIOUS); | 544 | XICS_IRQ_SPURIOUS); |
545 | BUG_ON(xics_host == NULL); | 545 | BUG_ON(xics_host == NULL); |
546 | irq_set_default_host(xics_host); | 546 | irq_set_default_host(xics_host); |
diff --git a/arch/powerpc/sysdev/commproc.c b/arch/powerpc/sysdev/commproc.c index e8e79f83d198..05dc30b80e29 100644 --- a/arch/powerpc/sysdev/commproc.c +++ b/arch/powerpc/sysdev/commproc.c | |||
@@ -50,7 +50,6 @@ static uint host_end; /* end + 1 */ | |||
50 | cpm8xx_t *cpmp; /* Pointer to comm processor space */ | 50 | cpm8xx_t *cpmp; /* Pointer to comm processor space */ |
51 | cpic8xx_t *cpic_reg; | 51 | cpic8xx_t *cpic_reg; |
52 | 52 | ||
53 | static struct device_node *cpm_pic_node; | ||
54 | static struct irq_host *cpm_pic_host; | 53 | static struct irq_host *cpm_pic_host; |
55 | 54 | ||
56 | static void cpm_mask_irq(unsigned int irq) | 55 | static void cpm_mask_irq(unsigned int irq) |
@@ -97,7 +96,7 @@ int cpm_get_irq(void) | |||
97 | 96 | ||
98 | static int cpm_pic_host_match(struct irq_host *h, struct device_node *node) | 97 | static int cpm_pic_host_match(struct irq_host *h, struct device_node *node) |
99 | { | 98 | { |
100 | return cpm_pic_node == node; | 99 | return h->of_node == node; |
101 | } | 100 | } |
102 | 101 | ||
103 | static int cpm_pic_host_map(struct irq_host *h, unsigned int virq, | 102 | static int cpm_pic_host_map(struct irq_host *h, unsigned int virq, |
@@ -165,9 +164,8 @@ unsigned int cpm_pic_init(void) | |||
165 | 164 | ||
166 | out_be32(&cpic_reg->cpic_cimr, 0); | 165 | out_be32(&cpic_reg->cpic_cimr, 0); |
167 | 166 | ||
168 | cpm_pic_node = of_node_get(np); | 167 | cpm_pic_host = irq_alloc_host(of_node_get(np), IRQ_HOST_MAP_LINEAR, |
169 | 168 | 64, &cpm_pic_host_ops, 64); | |
170 | cpm_pic_host = irq_alloc_host(IRQ_HOST_MAP_LINEAR, 64, &cpm_pic_host_ops, 64); | ||
171 | if (cpm_pic_host == NULL) { | 169 | if (cpm_pic_host == NULL) { |
172 | printk(KERN_ERR "CPM2 PIC: failed to allocate irq host!\n"); | 170 | printk(KERN_ERR "CPM2 PIC: failed to allocate irq host!\n"); |
173 | sirq = NO_IRQ; | 171 | sirq = NO_IRQ; |
diff --git a/arch/powerpc/sysdev/cpm2_pic.c b/arch/powerpc/sysdev/cpm2_pic.c index eabfe06fe05c..d9ab30c66ebf 100644 --- a/arch/powerpc/sysdev/cpm2_pic.c +++ b/arch/powerpc/sysdev/cpm2_pic.c | |||
@@ -50,7 +50,6 @@ | |||
50 | 50 | ||
51 | static intctl_cpm2_t *cpm2_intctl; | 51 | static intctl_cpm2_t *cpm2_intctl; |
52 | 52 | ||
53 | static struct device_node *cpm2_pic_node; | ||
54 | static struct irq_host *cpm2_pic_host; | 53 | static struct irq_host *cpm2_pic_host; |
55 | #define NR_MASK_WORDS ((NR_IRQS + 31) / 32) | 54 | #define NR_MASK_WORDS ((NR_IRQS + 31) / 32) |
56 | static unsigned long ppc_cached_irq_mask[NR_MASK_WORDS]; | 55 | static unsigned long ppc_cached_irq_mask[NR_MASK_WORDS]; |
@@ -208,7 +207,7 @@ unsigned int cpm2_get_irq(void) | |||
208 | 207 | ||
209 | static int cpm2_pic_host_match(struct irq_host *h, struct device_node *node) | 208 | static int cpm2_pic_host_match(struct irq_host *h, struct device_node *node) |
210 | { | 209 | { |
211 | return cpm2_pic_node == node; | 210 | return h->of_node == node; |
212 | } | 211 | } |
213 | 212 | ||
214 | static int cpm2_pic_host_map(struct irq_host *h, unsigned int virq, | 213 | static int cpm2_pic_host_map(struct irq_host *h, unsigned int virq, |
@@ -273,8 +272,8 @@ void cpm2_pic_init(struct device_node *node) | |||
273 | out_be32(&cpm2_intctl->ic_scprrl, 0x05309770); | 272 | out_be32(&cpm2_intctl->ic_scprrl, 0x05309770); |
274 | 273 | ||
275 | /* create a legacy host */ | 274 | /* create a legacy host */ |
276 | cpm2_pic_node = of_node_get(node); | 275 | cpm2_pic_host = irq_alloc_host(of_node_get(node), IRQ_HOST_MAP_LINEAR, |
277 | cpm2_pic_host = irq_alloc_host(IRQ_HOST_MAP_LINEAR, 64, &cpm2_pic_host_ops, 64); | 276 | 64, &cpm2_pic_host_ops, 64); |
278 | if (cpm2_pic_host == NULL) { | 277 | if (cpm2_pic_host == NULL) { |
279 | printk(KERN_ERR "CPM2 PIC: failed to allocate irq host!\n"); | 278 | printk(KERN_ERR "CPM2 PIC: failed to allocate irq host!\n"); |
280 | return; | 279 | return; |
diff --git a/arch/powerpc/sysdev/i8259.c b/arch/powerpc/sysdev/i8259.c index ad87adc975bc..7c1b27ac7d3c 100644 --- a/arch/powerpc/sysdev/i8259.c +++ b/arch/powerpc/sysdev/i8259.c | |||
@@ -25,7 +25,6 @@ static unsigned char cached_8259[2] = { 0xff, 0xff }; | |||
25 | 25 | ||
26 | static DEFINE_SPINLOCK(i8259_lock); | 26 | static DEFINE_SPINLOCK(i8259_lock); |
27 | 27 | ||
28 | static struct device_node *i8259_node; | ||
29 | static struct irq_host *i8259_host; | 28 | static struct irq_host *i8259_host; |
30 | 29 | ||
31 | /* | 30 | /* |
@@ -165,7 +164,7 @@ static struct resource pic_edgectrl_iores = { | |||
165 | 164 | ||
166 | static int i8259_host_match(struct irq_host *h, struct device_node *node) | 165 | static int i8259_host_match(struct irq_host *h, struct device_node *node) |
167 | { | 166 | { |
168 | return i8259_node == NULL || i8259_node == node; | 167 | return h->of_node == NULL || h->of_node == node; |
169 | } | 168 | } |
170 | 169 | ||
171 | static int i8259_host_map(struct irq_host *h, unsigned int virq, | 170 | static int i8259_host_map(struct irq_host *h, unsigned int virq, |
@@ -276,9 +275,8 @@ void i8259_init(struct device_node *node, unsigned long intack_addr) | |||
276 | spin_unlock_irqrestore(&i8259_lock, flags); | 275 | spin_unlock_irqrestore(&i8259_lock, flags); |
277 | 276 | ||
278 | /* create a legacy host */ | 277 | /* create a legacy host */ |
279 | if (node) | 278 | i8259_host = irq_alloc_host(of_node_get(node), IRQ_HOST_MAP_LEGACY, |
280 | i8259_node = of_node_get(node); | 279 | 0, &i8259_host_ops, 0); |
281 | i8259_host = irq_alloc_host(IRQ_HOST_MAP_LEGACY, 0, &i8259_host_ops, 0); | ||
282 | if (i8259_host == NULL) { | 280 | if (i8259_host == NULL) { |
283 | printk(KERN_ERR "i8259: failed to allocate irq host !\n"); | 281 | printk(KERN_ERR "i8259: failed to allocate irq host !\n"); |
284 | return; | 282 | return; |
diff --git a/arch/powerpc/sysdev/ipic.c b/arch/powerpc/sysdev/ipic.c index 473c415e9e25..05a56e55804c 100644 --- a/arch/powerpc/sysdev/ipic.c +++ b/arch/powerpc/sysdev/ipic.c | |||
@@ -511,10 +511,8 @@ static struct irq_chip ipic_irq_chip = { | |||
511 | 511 | ||
512 | static int ipic_host_match(struct irq_host *h, struct device_node *node) | 512 | static int ipic_host_match(struct irq_host *h, struct device_node *node) |
513 | { | 513 | { |
514 | struct ipic *ipic = h->host_data; | ||
515 | |||
516 | /* Exact match, unless ipic node is NULL */ | 514 | /* Exact match, unless ipic node is NULL */ |
517 | return ipic->of_node == NULL || ipic->of_node == node; | 515 | return h->of_node == NULL || h->of_node == node; |
518 | } | 516 | } |
519 | 517 | ||
520 | static int ipic_host_map(struct irq_host *h, unsigned int virq, | 518 | static int ipic_host_map(struct irq_host *h, unsigned int virq, |
@@ -568,9 +566,8 @@ struct ipic * __init ipic_init(struct device_node *node, unsigned int flags) | |||
568 | return NULL; | 566 | return NULL; |
569 | 567 | ||
570 | memset(ipic, 0, sizeof(struct ipic)); | 568 | memset(ipic, 0, sizeof(struct ipic)); |
571 | ipic->of_node = of_node_get(node); | ||
572 | 569 | ||
573 | ipic->irqhost = irq_alloc_host(IRQ_HOST_MAP_LINEAR, | 570 | ipic->irqhost = irq_alloc_host(of_node_get(node), IRQ_HOST_MAP_LINEAR, |
574 | NR_IPIC_INTS, | 571 | NR_IPIC_INTS, |
575 | &ipic_host_ops, 0); | 572 | &ipic_host_ops, 0); |
576 | if (ipic->irqhost == NULL) { | 573 | if (ipic->irqhost == NULL) { |
diff --git a/arch/powerpc/sysdev/ipic.h b/arch/powerpc/sysdev/ipic.h index c28e589877eb..bb309a501b2d 100644 --- a/arch/powerpc/sysdev/ipic.h +++ b/arch/powerpc/sysdev/ipic.h | |||
@@ -48,9 +48,6 @@ struct ipic { | |||
48 | 48 | ||
49 | /* The "linux" controller struct */ | 49 | /* The "linux" controller struct */ |
50 | struct irq_chip hc_irq; | 50 | struct irq_chip hc_irq; |
51 | |||
52 | /* The device node of the interrupt controller */ | ||
53 | struct device_node *of_node; | ||
54 | }; | 51 | }; |
55 | 52 | ||
56 | struct ipic_info { | 53 | struct ipic_info { |
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 | } |
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c index 74c64c0d3b71..25a81f73cecf 100644 --- a/arch/powerpc/sysdev/mpic.c +++ b/arch/powerpc/sysdev/mpic.c | |||
@@ -271,7 +271,7 @@ static void _mpic_map_dcr(struct mpic *mpic, struct mpic_reg_bank *rb, | |||
271 | { | 271 | { |
272 | rb->dbase = mpic->dcr_base; | 272 | rb->dbase = mpic->dcr_base; |
273 | rb->doff = offset; | 273 | rb->doff = offset; |
274 | rb->dhost = dcr_map(mpic->of_node, rb->dbase + rb->doff, size); | 274 | rb->dhost = dcr_map(mpic->irqhost->of_node, rb->dbase + rb->doff, size); |
275 | BUG_ON(!DCR_MAP_OK(rb->dhost)); | 275 | BUG_ON(!DCR_MAP_OK(rb->dhost)); |
276 | } | 276 | } |
277 | 277 | ||
@@ -861,10 +861,8 @@ static struct irq_chip mpic_irq_ht_chip = { | |||
861 | 861 | ||
862 | static int mpic_host_match(struct irq_host *h, struct device_node *node) | 862 | static int mpic_host_match(struct irq_host *h, struct device_node *node) |
863 | { | 863 | { |
864 | struct mpic *mpic = h->host_data; | ||
865 | |||
866 | /* Exact match, unless mpic node is NULL */ | 864 | /* Exact match, unless mpic node is NULL */ |
867 | return mpic->of_node == NULL || mpic->of_node == node; | 865 | return h->of_node == NULL || h->of_node == node; |
868 | } | 866 | } |
869 | 867 | ||
870 | static int mpic_host_map(struct irq_host *h, unsigned int virq, | 868 | static int mpic_host_map(struct irq_host *h, unsigned int virq, |
@@ -985,10 +983,9 @@ struct mpic * __init mpic_alloc(struct device_node *node, | |||
985 | 983 | ||
986 | memset(mpic, 0, sizeof(struct mpic)); | 984 | memset(mpic, 0, sizeof(struct mpic)); |
987 | mpic->name = name; | 985 | mpic->name = name; |
988 | mpic->of_node = of_node_get(node); | ||
989 | 986 | ||
990 | mpic->irqhost = irq_alloc_host(IRQ_HOST_MAP_LINEAR, isu_size, | 987 | mpic->irqhost = irq_alloc_host(of_node_get(node), IRQ_HOST_MAP_LINEAR, |
991 | &mpic_host_ops, | 988 | isu_size, &mpic_host_ops, |
992 | flags & MPIC_LARGE_VECTORS ? 2048 : 256); | 989 | flags & MPIC_LARGE_VECTORS ? 2048 : 256); |
993 | if (mpic->irqhost == NULL) { | 990 | if (mpic->irqhost == NULL) { |
994 | of_node_put(node); | 991 | of_node_put(node); |
diff --git a/arch/powerpc/sysdev/mpic_msi.c b/arch/powerpc/sysdev/mpic_msi.c index b076793033c2..9ca4d8f444ff 100644 --- a/arch/powerpc/sysdev/mpic_msi.c +++ b/arch/powerpc/sysdev/mpic_msi.c | |||
@@ -117,16 +117,17 @@ static int mpic_msi_reserve_dt_hwirqs(struct mpic *mpic) | |||
117 | int i, len; | 117 | int i, len; |
118 | const u32 *p; | 118 | const u32 *p; |
119 | 119 | ||
120 | p = of_get_property(mpic->of_node, "msi-available-ranges", &len); | 120 | p = of_get_property(mpic->irqhost->of_node, |
121 | "msi-available-ranges", &len); | ||
121 | if (!p) { | 122 | if (!p) { |
122 | pr_debug("mpic: no msi-available-ranges property found on %s\n", | 123 | pr_debug("mpic: no msi-available-ranges property found on %s\n", |
123 | mpic->of_node->full_name); | 124 | mpic->irqhost->of_node->full_name); |
124 | return -ENODEV; | 125 | return -ENODEV; |
125 | } | 126 | } |
126 | 127 | ||
127 | if (len % 8 != 0) { | 128 | if (len % 8 != 0) { |
128 | printk(KERN_WARNING "mpic: Malformed msi-available-ranges " | 129 | printk(KERN_WARNING "mpic: Malformed msi-available-ranges " |
129 | "property on %s\n", mpic->of_node->full_name); | 130 | "property on %s\n", mpic->irqhost->of_node->full_name); |
130 | return -EINVAL; | 131 | return -EINVAL; |
131 | } | 132 | } |
132 | 133 | ||
diff --git a/arch/powerpc/sysdev/mv64x60_pic.c b/arch/powerpc/sysdev/mv64x60_pic.c index 01d316287772..a145bfd003c7 100644 --- a/arch/powerpc/sysdev/mv64x60_pic.c +++ b/arch/powerpc/sysdev/mv64x60_pic.c | |||
@@ -204,7 +204,7 @@ static struct irq_chip mv64x60_chip_gpp = { | |||
204 | 204 | ||
205 | static int mv64x60_host_match(struct irq_host *h, struct device_node *np) | 205 | static int mv64x60_host_match(struct irq_host *h, struct device_node *np) |
206 | { | 206 | { |
207 | return mv64x60_irq_host->host_data == np; | 207 | return h->of_node == np; |
208 | } | 208 | } |
209 | 209 | ||
210 | static struct irq_chip *mv64x60_chips[] = { | 210 | static struct irq_chip *mv64x60_chips[] = { |
@@ -253,14 +253,12 @@ void __init mv64x60_init_irq(void) | |||
253 | np = of_find_compatible_node(NULL, NULL, "marvell,mv64x60-pic"); | 253 | np = of_find_compatible_node(NULL, NULL, "marvell,mv64x60-pic"); |
254 | reg = of_get_property(np, "reg", &size); | 254 | reg = of_get_property(np, "reg", &size); |
255 | paddr = of_translate_address(np, reg); | 255 | paddr = of_translate_address(np, reg); |
256 | of_node_put(np); | ||
257 | mv64x60_irq_reg_base = ioremap(paddr, reg[1]); | 256 | mv64x60_irq_reg_base = ioremap(paddr, reg[1]); |
258 | 257 | ||
259 | mv64x60_irq_host = irq_alloc_host(IRQ_HOST_MAP_LINEAR, MV64x60_NUM_IRQS, | 258 | mv64x60_irq_host = irq_alloc_host(np, IRQ_HOST_MAP_LINEAR, |
259 | MV64x60_NUM_IRQS, | ||
260 | &mv64x60_host_ops, MV64x60_NUM_IRQS); | 260 | &mv64x60_host_ops, MV64x60_NUM_IRQS); |
261 | 261 | ||
262 | mv64x60_irq_host->host_data = np; | ||
263 | |||
264 | spin_lock_irqsave(&mv64x60_lock, flags); | 262 | spin_lock_irqsave(&mv64x60_lock, flags); |
265 | out_le32(mv64x60_gpp_reg_base + MV64x60_GPP_INTR_MASK, | 263 | out_le32(mv64x60_gpp_reg_base + MV64x60_GPP_INTR_MASK, |
266 | mv64x60_cached_gpp_mask); | 264 | mv64x60_cached_gpp_mask); |
diff --git a/arch/powerpc/sysdev/qe_lib/qe_ic.c b/arch/powerpc/sysdev/qe_lib/qe_ic.c index 4d1dcb45963d..55e6f394af82 100644 --- a/arch/powerpc/sysdev/qe_lib/qe_ic.c +++ b/arch/powerpc/sysdev/qe_lib/qe_ic.c | |||
@@ -245,10 +245,8 @@ static struct irq_chip qe_ic_irq_chip = { | |||
245 | 245 | ||
246 | static int qe_ic_host_match(struct irq_host *h, struct device_node *node) | 246 | static int qe_ic_host_match(struct irq_host *h, struct device_node *node) |
247 | { | 247 | { |
248 | struct qe_ic *qe_ic = h->host_data; | ||
249 | |||
250 | /* Exact match, unless qe_ic node is NULL */ | 248 | /* Exact match, unless qe_ic node is NULL */ |
251 | return qe_ic->of_node == NULL || qe_ic->of_node == node; | 249 | return h->of_node == NULL || h->of_node == node; |
252 | } | 250 | } |
253 | 251 | ||
254 | static int qe_ic_host_map(struct irq_host *h, unsigned int virq, | 252 | static int qe_ic_host_map(struct irq_host *h, unsigned int virq, |
@@ -352,9 +350,8 @@ void __init qe_ic_init(struct device_node *node, unsigned int flags) | |||
352 | return; | 350 | return; |
353 | 351 | ||
354 | memset(qe_ic, 0, sizeof(struct qe_ic)); | 352 | memset(qe_ic, 0, sizeof(struct qe_ic)); |
355 | qe_ic->of_node = of_node_get(node); | ||
356 | 353 | ||
357 | qe_ic->irqhost = irq_alloc_host(IRQ_HOST_MAP_LINEAR, | 354 | qe_ic->irqhost = irq_alloc_host(of_node_get(node), IRQ_HOST_MAP_LINEAR, |
358 | NR_QE_IC_INTS, &qe_ic_host_ops, 0); | 355 | NR_QE_IC_INTS, &qe_ic_host_ops, 0); |
359 | if (qe_ic->irqhost == NULL) { | 356 | if (qe_ic->irqhost == NULL) { |
360 | of_node_put(node); | 357 | of_node_put(node); |
diff --git a/arch/powerpc/sysdev/qe_lib/qe_ic.h b/arch/powerpc/sysdev/qe_lib/qe_ic.h index 9a631adb189d..c1361d005a8a 100644 --- a/arch/powerpc/sysdev/qe_lib/qe_ic.h +++ b/arch/powerpc/sysdev/qe_lib/qe_ic.h | |||
@@ -84,9 +84,6 @@ struct qe_ic { | |||
84 | /* The "linux" controller struct */ | 84 | /* The "linux" controller struct */ |
85 | struct irq_chip hc_irq; | 85 | struct irq_chip hc_irq; |
86 | 86 | ||
87 | /* The device node of the interrupt controller */ | ||
88 | struct device_node *of_node; | ||
89 | |||
90 | /* VIRQ numbers of QE high/low irqs */ | 87 | /* VIRQ numbers of QE high/low irqs */ |
91 | unsigned int virq_high; | 88 | unsigned int virq_high; |
92 | unsigned int virq_low; | 89 | unsigned int virq_low; |
diff --git a/arch/powerpc/sysdev/tsi108_pci.c b/arch/powerpc/sysdev/tsi108_pci.c index cf0bfbd73401..b41492a8d600 100644 --- a/arch/powerpc/sysdev/tsi108_pci.c +++ b/arch/powerpc/sysdev/tsi108_pci.c | |||
@@ -52,7 +52,6 @@ | |||
52 | u32 tsi108_pci_cfg_base; | 52 | u32 tsi108_pci_cfg_base; |
53 | static u32 tsi108_pci_cfg_phys; | 53 | static u32 tsi108_pci_cfg_phys; |
54 | u32 tsi108_csr_vir_base; | 54 | u32 tsi108_csr_vir_base; |
55 | static struct device_node *pci_irq_node; | ||
56 | static struct irq_host *pci_irq_host; | 55 | static struct irq_host *pci_irq_host; |
57 | 56 | ||
58 | extern u32 get_vir_csrbase(void); | 57 | extern u32 get_vir_csrbase(void); |
@@ -407,7 +406,7 @@ static int pci_irq_host_map(struct irq_host *h, unsigned int virq, | |||
407 | 406 | ||
408 | static int pci_irq_host_match(struct irq_host *h, struct device_node *node) | 407 | static int pci_irq_host_match(struct irq_host *h, struct device_node *node) |
409 | { | 408 | { |
410 | return pci_irq_node == node; | 409 | return h->of_node == node; |
411 | } | 410 | } |
412 | 411 | ||
413 | static struct irq_host_ops pci_irq_host_ops = { | 412 | static struct irq_host_ops pci_irq_host_ops = { |
@@ -433,10 +432,11 @@ void __init tsi108_pci_int_init(struct device_node *node) | |||
433 | { | 432 | { |
434 | DBG("Tsi108_pci_int_init: initializing PCI interrupts\n"); | 433 | DBG("Tsi108_pci_int_init: initializing PCI interrupts\n"); |
435 | 434 | ||
436 | pci_irq_node = of_node_get(node); | 435 | pci_irq_host = irq_alloc_host(of_node_get(node), IRQ_HOST_MAP_LEGACY, |
437 | pci_irq_host = irq_alloc_host(IRQ_HOST_MAP_LEGACY, 0, &pci_irq_host_ops, 0); | 436 | 0, &pci_irq_host_ops, 0); |
438 | if (pci_irq_host == NULL) { | 437 | if (pci_irq_host == NULL) { |
439 | printk(KERN_ERR "pci_irq_host: failed to allocate irq host !\n"); | 438 | printk(KERN_ERR "pci_irq_host: failed to allocate irq host !\n"); |
439 | of_node_put(node); | ||
440 | return; | 440 | return; |
441 | } | 441 | } |
442 | 442 | ||
diff --git a/arch/powerpc/sysdev/uic.c b/arch/powerpc/sysdev/uic.c index 47180b3fca56..bf3766754173 100644 --- a/arch/powerpc/sysdev/uic.c +++ b/arch/powerpc/sysdev/uic.c | |||
@@ -56,9 +56,6 @@ struct uic { | |||
56 | 56 | ||
57 | /* For secondary UICs, the cascade interrupt's irqaction */ | 57 | /* For secondary UICs, the cascade interrupt's irqaction */ |
58 | struct irqaction cascade; | 58 | struct irqaction cascade; |
59 | |||
60 | /* The device node of the interrupt controller */ | ||
61 | struct device_node *of_node; | ||
62 | }; | 59 | }; |
63 | 60 | ||
64 | static void uic_unmask_irq(unsigned int virq) | 61 | static void uic_unmask_irq(unsigned int virq) |
@@ -220,8 +217,7 @@ out_unlock: | |||
220 | 217 | ||
221 | static int uic_host_match(struct irq_host *h, struct device_node *node) | 218 | static int uic_host_match(struct irq_host *h, struct device_node *node) |
222 | { | 219 | { |
223 | struct uic *uic = h->host_data; | 220 | return h->of_node == node; |
224 | return uic->of_node == node; | ||
225 | } | 221 | } |
226 | 222 | ||
227 | static int uic_host_map(struct irq_host *h, unsigned int virq, | 223 | static int uic_host_map(struct irq_host *h, unsigned int virq, |
@@ -291,7 +287,6 @@ static struct uic * __init uic_init_one(struct device_node *node) | |||
291 | 287 | ||
292 | memset(uic, 0, sizeof(*uic)); | 288 | memset(uic, 0, sizeof(*uic)); |
293 | spin_lock_init(&uic->lock); | 289 | spin_lock_init(&uic->lock); |
294 | uic->of_node = of_node_get(node); | ||
295 | indexp = of_get_property(node, "cell-index", &len); | 290 | indexp = of_get_property(node, "cell-index", &len); |
296 | if (!indexp || (len != sizeof(u32))) { | 291 | if (!indexp || (len != sizeof(u32))) { |
297 | printk(KERN_ERR "uic: Device node %s has missing or invalid " | 292 | printk(KERN_ERR "uic: Device node %s has missing or invalid " |
@@ -308,8 +303,8 @@ static struct uic * __init uic_init_one(struct device_node *node) | |||
308 | } | 303 | } |
309 | uic->dcrbase = *dcrreg; | 304 | uic->dcrbase = *dcrreg; |
310 | 305 | ||
311 | uic->irqhost = irq_alloc_host(IRQ_HOST_MAP_LINEAR, NR_UIC_INTS, | 306 | uic->irqhost = irq_alloc_host(of_node_get(node), IRQ_HOST_MAP_LINEAR, |
312 | &uic_host_ops, -1); | 307 | NR_UIC_INTS, &uic_host_ops, -1); |
313 | if (! uic->irqhost) { | 308 | if (! uic->irqhost) { |
314 | of_node_put(node); | 309 | of_node_put(node); |
315 | return NULL; /* FIXME: panic? */ | 310 | return NULL; /* FIXME: panic? */ |