Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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>

authored by

Michael Ellerman and committed by
Paul Mackerras
52964f87 0ae0b545

+76 -109
+6 -4
arch/powerpc/kernel/irq.c
··· 418 418 } 419 419 EXPORT_SYMBOL_GPL(virq_to_hw); 420 420 421 - __init_refok struct irq_host *irq_alloc_host(unsigned int revmap_type, 422 - unsigned int revmap_arg, 423 - struct irq_host_ops *ops, 424 - irq_hw_number_t inval_irq) 421 + __init_refok struct irq_host *irq_alloc_host(struct device_node *of_node, 422 + unsigned int revmap_type, 423 + unsigned int revmap_arg, 424 + struct irq_host_ops *ops, 425 + irq_hw_number_t inval_irq) 425 426 { 426 427 struct irq_host *host; 427 428 unsigned int size = sizeof(struct irq_host); ··· 447 446 host->revmap_type = revmap_type; 448 447 host->inval_irq = inval_irq; 449 448 host->ops = ops; 449 + host->of_node = of_node; 450 450 451 451 spin_lock_irqsave(&irq_big_lock, flags); 452 452
+2 -3
arch/powerpc/platforms/52xx/mpc52xx_pic.c
··· 244 244 static int mpc52xx_irqhost_match(struct irq_host *h, struct device_node *node) 245 245 { 246 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 250 static int mpc52xx_irqhost_xlate(struct irq_host *h, struct device_node *ct, ··· 419 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 423 MPC52xx_IRQ_HIGHTESTHWIRQ, 424 424 &mpc52xx_irqhost_ops, -1); 425 425 426 426 if (!mpc52xx_irqhost) 427 427 panic(__FILE__ ": Cannot allocate the IRQ host\n"); 428 428 429 - mpc52xx_irqhost->host_data = picnode; 430 429 printk(KERN_INFO "MPC52xx PIC is up and running!\n"); 431 430 } 432 431
+2 -5
arch/powerpc/platforms/82xx/mpc82xx_ads.c
··· 61 61 62 62 static unsigned long pci_int_base; 63 63 static struct irq_host *pci_pic_host; 64 - static struct device_node *pci_pic_node; 65 64 #endif 66 65 67 66 static void __init mpc82xx_ads_pic_init(void) ··· 400 401 401 402 static int pci_pic_host_match(struct irq_host *h, struct device_node *node) 402 403 { 403 - return node == pci_pic_node; 404 + return h->of_node == node; 404 405 } 405 406 406 407 static int pci_pic_host_map(struct irq_host *h, unsigned int virq, ··· 477 478 iounmap(immap); 478 479 return; 479 480 } 480 - pci_pic_node = of_node_get(np); 481 481 /* PCI interrupt controller registers: status and mask */ 482 482 regs = of_get_property(np, "reg", &size); 483 483 if ((!regs) || (size <= 2)) { ··· 488 490 ioremap(regs[0], sizeof(*pci_regs.pci_int_stat_reg)); 489 491 pci_regs.pci_int_mask_reg = 490 492 ioremap(regs[1], sizeof(*pci_regs.pci_int_mask_reg)); 491 - of_node_put(np); 492 493 /* configure chip select for PCI interrupt controller */ 493 494 immap->im_memctl.memc_br3 = regs[0] | 0x00001801; 494 495 immap->im_memctl.memc_or3 = 0xffff8010; ··· 498 501 *pci_regs.pci_int_mask_reg |= 0xfff00000; 499 502 iounmap(immap); 500 503 pci_pic_host = 501 - irq_alloc_host(IRQ_HOST_MAP_LINEAR, irq_max - irq_min + 1, 504 + irq_alloc_host(np, IRQ_HOST_MAP_LINEAR, irq_max - irq_min + 1, 502 505 &pci_pic_host_ops, irq_max + 1); 503 506 return; 504 507 }
+5 -9
arch/powerpc/platforms/cell/axon_msi.c
··· 64 64 65 65 66 66 struct axon_msic { 67 - struct device_node *dn; 68 67 struct irq_host *irq_host; 69 68 __le32 *fifo; 70 69 dcr_host_t dcr_host; ··· 296 297 297 298 static int msic_host_match(struct irq_host *host, struct device_node *dn) 298 299 { 299 - struct axon_msic *msic = host->host_data; 300 - 301 - return msic->dn == dn; 300 + return host->of_node == dn; 302 301 } 303 302 304 303 static struct irq_host_ops msic_host_ops = { ··· 311 314 u32 tmp; 312 315 313 316 list_for_each_entry(msic, &axon_msic_list, list) { 314 - pr_debug("axon_msi: disabling %s\n", msic->dn->full_name); 317 + pr_debug("axon_msi: disabling %s\n", 318 + msic->irq_host->of_node->full_name); 315 319 tmp = msic_dcr_read(msic, MSIC_CTRL_REG); 316 320 tmp &= ~MSIC_CTRL_ENABLE & ~MSIC_CTRL_IRQ_ENABLE; 317 321 msic_dcr_write(msic, MSIC_CTRL_REG, tmp); ··· 368 370 369 371 msic->fifo = page_address(page); 370 372 371 - msic->irq_host = irq_alloc_host(IRQ_HOST_MAP_NOMAP, NR_IRQS, 372 - &msic_host_ops, 0); 373 + msic->irq_host = irq_alloc_host(of_node_get(dn), IRQ_HOST_MAP_NOMAP, 374 + NR_IRQS, &msic_host_ops, 0); 373 375 if (!msic->irq_host) { 374 376 printk(KERN_ERR "axon_msi: couldn't allocate irq_host for %s\n", 375 377 dn->full_name); ··· 384 386 dn->full_name); 385 387 goto out_free_host; 386 388 } 387 - 388 - msic->dn = of_node_get(dn); 389 389 390 390 set_irq_data(virq, msic); 391 391 set_irq_chained_handler(virq, axon_msi_cascade);
+1 -1
arch/powerpc/platforms/cell/interrupt.c
··· 381 381 void __init iic_init_IRQ(void) 382 382 { 383 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 385 &iic_host_ops, IIC_IRQ_INVALID); 386 386 BUG_ON(iic_host == NULL); 387 387 irq_set_default_host(iic_host);
+7 -11
arch/powerpc/platforms/cell/spider-pic.c
··· 63 63 64 64 struct spider_pic { 65 65 struct irq_host *host; 66 - struct device_node *of_node; 67 66 void __iomem *regs; 68 67 unsigned int node_id; 69 68 }; ··· 177 178 178 179 static int spider_host_match(struct irq_host *h, struct device_node *node) 179 180 { 180 - struct spider_pic *pic = h->host_data; 181 - return node == pic->of_node; 181 + return h->of_node == node; 182 182 } 183 183 184 184 static int spider_host_map(struct irq_host *h, unsigned int virq, ··· 245 247 * tree in case the device-tree is ever fixed 246 248 */ 247 249 struct of_irq oirq; 248 - if (of_irq_map_one(pic->of_node, 0, &oirq) == 0) { 250 + if (of_irq_map_one(pic->host->of_node, 0, &oirq) == 0) { 249 251 virq = irq_create_of_mapping(oirq.controller, oirq.specifier, 250 252 oirq.size); 251 253 return virq; 252 254 } 253 255 254 256 /* Now do the horrible hacks */ 255 - tmp = of_get_property(pic->of_node, "#interrupt-cells", NULL); 257 + tmp = of_get_property(pic->host->of_node, "#interrupt-cells", NULL); 256 258 if (tmp == NULL) 257 259 return NO_IRQ; 258 260 intsize = *tmp; 259 - imap = of_get_property(pic->of_node, "interrupt-map", &imaplen); 261 + imap = of_get_property(pic->host->of_node, "interrupt-map", &imaplen); 260 262 if (imap == NULL || imaplen < (intsize + 1)) 261 263 return NO_IRQ; 262 264 iic = of_find_node_by_phandle(imap[intsize]); ··· 306 308 panic("spider_pic: can't map registers !"); 307 309 308 310 /* Allocate a host */ 309 - pic->host = irq_alloc_host(IRQ_HOST_MAP_LINEAR, SPIDER_SRC_COUNT, 310 - &spider_host_ops, SPIDER_IRQ_INVALID); 311 + pic->host = irq_alloc_host(of_node_get(of_node), IRQ_HOST_MAP_LINEAR, 312 + SPIDER_SRC_COUNT, &spider_host_ops, 313 + SPIDER_IRQ_INVALID); 311 314 if (pic->host == NULL) 312 315 panic("spider_pic: can't allocate irq host !"); 313 316 pic->host->host_data = pic; 314 - 315 - /* Fill out other bits */ 316 - pic->of_node = of_node_get(of_node); 317 317 318 318 /* Go through all sources and disable them */ 319 319 for (i = 0; i < SPIDER_SRC_COUNT; i++) {
+1 -1
arch/powerpc/platforms/celleb/interrupt.c
··· 242 242 ppc_md.get_irq = beatic_get_irq; 243 243 244 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 246 &beatic_pic_host_ops, 247 247 0); 248 248 BUG_ON(beatic_host == NULL);
+2 -1
arch/powerpc/platforms/iseries/irq.c
··· 369 369 /* Create irq host. No need for a revmap since HV will give us 370 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 374 BUG_ON(host == NULL); 374 375 irq_set_default_host(host); 375 376
+1 -1
arch/powerpc/platforms/powermac/pic.c
··· 384 384 /* 385 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 388 &pmac_pic_host_ops, 389 389 max_irqs); 390 390 BUG_ON(pmac_pic_host == NULL);
+1 -1
arch/powerpc/platforms/ps3/interrupt.c
··· 726 726 unsigned cpu; 727 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 730 PS3_INVALID_OUTLET); 731 731 irq_set_default_host(host); 732 732 irq_set_virq_count(PS3_PLUG_MAX + 1);
+1 -1
arch/powerpc/platforms/pseries/xics.c
··· 540 540 ops = &xics_host_lpar_ops; 541 541 else 542 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 544 XICS_IRQ_SPURIOUS); 545 545 BUG_ON(xics_host == NULL); 546 546 irq_set_default_host(xics_host);
+3 -5
arch/powerpc/sysdev/commproc.c
··· 50 50 cpm8xx_t *cpmp; /* Pointer to comm processor space */ 51 51 cpic8xx_t *cpic_reg; 52 52 53 - static struct device_node *cpm_pic_node; 54 53 static struct irq_host *cpm_pic_host; 55 54 56 55 static void cpm_mask_irq(unsigned int irq) ··· 96 97 97 98 static int cpm_pic_host_match(struct irq_host *h, struct device_node *node) 98 99 { 99 - return cpm_pic_node == node; 100 + return h->of_node == node; 100 101 } 101 102 102 103 static int cpm_pic_host_map(struct irq_host *h, unsigned int virq, ··· 164 165 165 166 out_be32(&cpic_reg->cpic_cimr, 0); 166 167 167 - cpm_pic_node = of_node_get(np); 168 - 169 - cpm_pic_host = irq_alloc_host(IRQ_HOST_MAP_LINEAR, 64, &cpm_pic_host_ops, 64); 168 + cpm_pic_host = irq_alloc_host(of_node_get(np), IRQ_HOST_MAP_LINEAR, 169 + 64, &cpm_pic_host_ops, 64); 170 170 if (cpm_pic_host == NULL) { 171 171 printk(KERN_ERR "CPM2 PIC: failed to allocate irq host!\n"); 172 172 sirq = NO_IRQ;
+3 -4
arch/powerpc/sysdev/cpm2_pic.c
··· 50 50 51 51 static intctl_cpm2_t *cpm2_intctl; 52 52 53 - static struct device_node *cpm2_pic_node; 54 53 static struct irq_host *cpm2_pic_host; 55 54 #define NR_MASK_WORDS ((NR_IRQS + 31) / 32) 56 55 static unsigned long ppc_cached_irq_mask[NR_MASK_WORDS]; ··· 207 208 208 209 static int cpm2_pic_host_match(struct irq_host *h, struct device_node *node) 209 210 { 210 - return cpm2_pic_node == node; 211 + return h->of_node == node; 211 212 } 212 213 213 214 static int cpm2_pic_host_map(struct irq_host *h, unsigned int virq, ··· 272 273 out_be32(&cpm2_intctl->ic_scprrl, 0x05309770); 273 274 274 275 /* create a legacy host */ 275 - cpm2_pic_node = of_node_get(node); 276 - cpm2_pic_host = irq_alloc_host(IRQ_HOST_MAP_LINEAR, 64, &cpm2_pic_host_ops, 64); 276 + cpm2_pic_host = irq_alloc_host(of_node_get(node), IRQ_HOST_MAP_LINEAR, 277 + 64, &cpm2_pic_host_ops, 64); 277 278 if (cpm2_pic_host == NULL) { 278 279 printk(KERN_ERR "CPM2 PIC: failed to allocate irq host!\n"); 279 280 return;
+3 -5
arch/powerpc/sysdev/i8259.c
··· 25 25 26 26 static DEFINE_SPINLOCK(i8259_lock); 27 27 28 - static struct device_node *i8259_node; 29 28 static struct irq_host *i8259_host; 30 29 31 30 /* ··· 164 165 165 166 static int i8259_host_match(struct irq_host *h, struct device_node *node) 166 167 { 167 - return i8259_node == NULL || i8259_node == node; 168 + return h->of_node == NULL || h->of_node == node; 168 169 } 169 170 170 171 static int i8259_host_map(struct irq_host *h, unsigned int virq, ··· 275 276 spin_unlock_irqrestore(&i8259_lock, flags); 276 277 277 278 /* create a legacy host */ 278 - if (node) 279 - i8259_node = of_node_get(node); 280 - i8259_host = irq_alloc_host(IRQ_HOST_MAP_LEGACY, 0, &i8259_host_ops, 0); 279 + i8259_host = irq_alloc_host(of_node_get(node), IRQ_HOST_MAP_LEGACY, 280 + 0, &i8259_host_ops, 0); 281 281 if (i8259_host == NULL) { 282 282 printk(KERN_ERR "i8259: failed to allocate irq host !\n"); 283 283 return;
+2 -5
arch/powerpc/sysdev/ipic.c
··· 511 511 512 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 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 518 static int ipic_host_map(struct irq_host *h, unsigned int virq, ··· 566 568 return NULL; 567 569 568 570 memset(ipic, 0, sizeof(struct ipic)); 569 - ipic->of_node = of_node_get(node); 570 571 571 - ipic->irqhost = irq_alloc_host(IRQ_HOST_MAP_LINEAR, 572 + ipic->irqhost = irq_alloc_host(of_node_get(node), IRQ_HOST_MAP_LINEAR, 572 573 NR_IPIC_INTS, 573 574 &ipic_host_ops, 0); 574 575 if (ipic->irqhost == NULL) {
-3
arch/powerpc/sysdev/ipic.h
··· 48 48 49 49 /* The "linux" controller struct */ 50 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 53 struct ipic_info {
+10 -9
arch/powerpc/sysdev/mpc8xx_pic.c
··· 19 19 20 20 extern int cpm_get_irq(struct pt_regs *regs); 21 21 22 - static struct device_node *mpc8xx_pic_node; 23 22 static struct irq_host *mpc8xx_pic_host; 24 23 #define NR_MASK_WORDS ((NR_IRQS + 31) / 32) 25 24 static unsigned long ppc_cached_irq_mask[NR_MASK_WORDS]; ··· 121 122 122 123 static int mpc8xx_pic_host_match(struct irq_host *h, struct device_node *node) 123 124 { 124 - return mpc8xx_pic_node == node; 125 + return h->of_node == node; 125 126 } 126 127 127 128 static int mpc8xx_pic_host_map(struct irq_host *h, unsigned int virq, ··· 175 176 return -ENOMEM; 176 177 } 177 178 178 - mpc8xx_pic_node = of_node_get(np); 179 - 180 179 ret = of_address_to_resource(np, 0, &res); 181 - of_node_put(np); 182 180 if (ret) 183 - return ret; 181 + goto out; 184 182 185 183 siu_reg = (void *)ioremap(res.start, res.end - res.start + 1); 186 - if (siu_reg == NULL) 187 - return -EINVAL; 184 + if (siu_reg == NULL) { 185 + ret = -EINVAL; 186 + goto out; 187 + } 188 188 189 - mpc8xx_pic_host = irq_alloc_host(IRQ_HOST_MAP_LINEAR, 64, &mpc8xx_pic_host_ops, 64); 189 + mpc8xx_pic_host = irq_alloc_host(of_node_get(np), IRQ_HOST_MAP_LINEAR, 190 + 64, &mpc8xx_pic_host_ops, 64); 190 191 if (mpc8xx_pic_host == NULL) { 191 192 printk(KERN_ERR "MPC8xx PIC: failed to allocate irq host!\n"); 192 193 ret = -ENOMEM; 193 194 } 194 195 196 + out: 197 + of_node_put(np); 195 198 return ret; 196 199 }
+4 -7
arch/powerpc/sysdev/mpic.c
··· 271 271 { 272 272 rb->dbase = mpic->dcr_base; 273 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 275 BUG_ON(!DCR_MAP_OK(rb->dhost)); 276 276 } 277 277 ··· 861 861 862 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 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 868 static int mpic_host_map(struct irq_host *h, unsigned int virq, ··· 983 985 984 986 memset(mpic, 0, sizeof(struct mpic)); 985 987 mpic->name = name; 986 - mpic->of_node = of_node_get(node); 987 988 988 - mpic->irqhost = irq_alloc_host(IRQ_HOST_MAP_LINEAR, isu_size, 989 - &mpic_host_ops, 989 + mpic->irqhost = irq_alloc_host(of_node_get(node), IRQ_HOST_MAP_LINEAR, 990 + isu_size, &mpic_host_ops, 990 991 flags & MPIC_LARGE_VECTORS ? 2048 : 256); 991 992 if (mpic->irqhost == NULL) { 992 993 of_node_put(node);
+4 -3
arch/powerpc/sysdev/mpic_msi.c
··· 117 117 int i, len; 118 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 122 if (!p) { 122 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 125 return -ENODEV; 125 126 } 126 127 127 128 if (len % 8 != 0) { 128 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 131 return -EINVAL; 131 132 } 132 133
+3 -5
arch/powerpc/sysdev/mv64x60_pic.c
··· 204 204 205 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 210 static struct irq_chip *mv64x60_chips[] = { ··· 253 253 np = of_find_compatible_node(NULL, NULL, "marvell,mv64x60-pic"); 254 254 reg = of_get_property(np, "reg", &size); 255 255 paddr = of_translate_address(np, reg); 256 - of_node_put(np); 257 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 260 &mv64x60_host_ops, MV64x60_NUM_IRQS); 261 - 262 - mv64x60_irq_host->host_data = np; 263 261 264 262 spin_lock_irqsave(&mv64x60_lock, flags); 265 263 out_le32(mv64x60_gpp_reg_base + MV64x60_GPP_INTR_MASK,
+2 -5
arch/powerpc/sysdev/qe_lib/qe_ic.c
··· 245 245 246 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 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 252 static int qe_ic_host_map(struct irq_host *h, unsigned int virq, ··· 350 352 return; 351 353 352 354 memset(qe_ic, 0, sizeof(struct qe_ic)); 353 - qe_ic->of_node = of_node_get(node); 354 355 355 - qe_ic->irqhost = irq_alloc_host(IRQ_HOST_MAP_LINEAR, 356 + qe_ic->irqhost = irq_alloc_host(of_node_get(node), IRQ_HOST_MAP_LINEAR, 356 357 NR_QE_IC_INTS, &qe_ic_host_ops, 0); 357 358 if (qe_ic->irqhost == NULL) { 358 359 of_node_put(node);
-3
arch/powerpc/sysdev/qe_lib/qe_ic.h
··· 84 84 /* The "linux" controller struct */ 85 85 struct irq_chip hc_irq; 86 86 87 - /* The device node of the interrupt controller */ 88 - struct device_node *of_node; 89 - 90 87 /* VIRQ numbers of QE high/low irqs */ 91 88 unsigned int virq_high; 92 89 unsigned int virq_low;
+4 -4
arch/powerpc/sysdev/tsi108_pci.c
··· 52 52 u32 tsi108_pci_cfg_base; 53 53 static u32 tsi108_pci_cfg_phys; 54 54 u32 tsi108_csr_vir_base; 55 - static struct device_node *pci_irq_node; 56 55 static struct irq_host *pci_irq_host; 57 56 58 57 extern u32 get_vir_csrbase(void); ··· 406 407 407 408 static int pci_irq_host_match(struct irq_host *h, struct device_node *node) 408 409 { 409 - return pci_irq_node == node; 410 + return h->of_node == node; 410 411 } 411 412 412 413 static struct irq_host_ops pci_irq_host_ops = { ··· 432 433 { 433 434 DBG("Tsi108_pci_int_init: initializing PCI interrupts\n"); 434 435 435 - pci_irq_node = of_node_get(node); 436 - pci_irq_host = irq_alloc_host(IRQ_HOST_MAP_LEGACY, 0, &pci_irq_host_ops, 0); 436 + pci_irq_host = irq_alloc_host(of_node_get(node), IRQ_HOST_MAP_LEGACY, 437 + 0, &pci_irq_host_ops, 0); 437 438 if (pci_irq_host == NULL) { 438 439 printk(KERN_ERR "pci_irq_host: failed to allocate irq host !\n"); 440 + of_node_put(node); 439 441 return; 440 442 } 441 443
+3 -8
arch/powerpc/sysdev/uic.c
··· 56 56 57 57 /* For secondary UICs, the cascade interrupt's irqaction */ 58 58 struct irqaction cascade; 59 - 60 - /* The device node of the interrupt controller */ 61 - struct device_node *of_node; 62 59 }; 63 60 64 61 static void uic_unmask_irq(unsigned int virq) ··· 217 220 218 221 static int uic_host_match(struct irq_host *h, struct device_node *node) 219 222 { 220 - struct uic *uic = h->host_data; 221 - return uic->of_node == node; 223 + return h->of_node == node; 222 224 } 223 225 224 226 static int uic_host_map(struct irq_host *h, unsigned int virq, ··· 287 291 288 292 memset(uic, 0, sizeof(*uic)); 289 293 spin_lock_init(&uic->lock); 290 - uic->of_node = of_node_get(node); 291 294 indexp = of_get_property(node, "cell-index", &len); 292 295 if (!indexp || (len != sizeof(u32))) { 293 296 printk(KERN_ERR "uic: Device node %s has missing or invalid " ··· 303 308 } 304 309 uic->dcrbase = *dcrreg; 305 310 306 - uic->irqhost = irq_alloc_host(IRQ_HOST_MAP_LINEAR, NR_UIC_INTS, 307 - &uic_host_ops, -1); 311 + uic->irqhost = irq_alloc_host(of_node_get(node), IRQ_HOST_MAP_LINEAR, 312 + NR_UIC_INTS, &uic_host_ops, -1); 308 313 if (! uic->irqhost) { 309 314 of_node_put(node); 310 315 return NULL; /* FIXME: panic? */
+6 -2
include/asm-powerpc/irq.h
··· 124 124 struct irq_host_ops *ops; 125 125 void *host_data; 126 126 irq_hw_number_t inval_irq; 127 + 128 + /* Optional device node pointer */ 129 + struct device_node *of_node; 127 130 }; 128 131 129 132 /* The main irq map itself is an array of NR_IRQ entries containing the ··· 145 142 146 143 /** 147 144 * irq_alloc_host - Allocate a new irq_host data structure 148 - * @node: device-tree node of the interrupt controller 145 + * @of_node: optional device-tree node of the interrupt controller 149 146 * @revmap_type: type of reverse mapping to use 150 147 * @revmap_arg: for IRQ_HOST_MAP_LINEAR linear only: size of the map 151 148 * @ops: map/unmap host callbacks ··· 159 156 * later during boot automatically (the reverse mapping will use the slow path 160 157 * until that happens). 161 158 */ 162 - extern struct irq_host *irq_alloc_host(unsigned int revmap_type, 159 + extern struct irq_host *irq_alloc_host(struct device_node *of_node, 160 + unsigned int revmap_type, 163 161 unsigned int revmap_arg, 164 162 struct irq_host_ops *ops, 165 163 irq_hw_number_t inval_irq);
-3
include/asm-powerpc/mpic.h
··· 240 240 /* The instance data of a given MPIC */ 241 241 struct mpic 242 242 { 243 - /* The device node of the interrupt controller */ 244 - struct device_node *of_node; 245 - 246 243 /* The remapper for this MPIC */ 247 244 struct irq_host *irqhost; 248 245