aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/sysdev
diff options
context:
space:
mode:
authorMichael Ellerman <michael@ellerman.id.au>2007-08-28 04:47:54 -0400
committerPaul Mackerras <paulus@samba.org>2007-09-13 11:33:20 -0400
commit52964f87c64e6c6ea671b5bf3030fb1494090a48 (patch)
tree2e20d81bc05b60b7108733daf5713ea640ad2477 /arch/powerpc/sysdev
parent0ae0b54565a8dcc2b98de694b998e765de15b713 (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/sysdev')
-rw-r--r--arch/powerpc/sysdev/commproc.c8
-rw-r--r--arch/powerpc/sysdev/cpm2_pic.c7
-rw-r--r--arch/powerpc/sysdev/i8259.c8
-rw-r--r--arch/powerpc/sysdev/ipic.c7
-rw-r--r--arch/powerpc/sysdev/ipic.h3
-rw-r--r--arch/powerpc/sysdev/mpc8xx_pic.c19
-rw-r--r--arch/powerpc/sysdev/mpic.c11
-rw-r--r--arch/powerpc/sysdev/mpic_msi.c7
-rw-r--r--arch/powerpc/sysdev/mv64x60_pic.c8
-rw-r--r--arch/powerpc/sysdev/qe_lib/qe_ic.c7
-rw-r--r--arch/powerpc/sysdev/qe_lib/qe_ic.h3
-rw-r--r--arch/powerpc/sysdev/tsi108_pci.c8
-rw-r--r--arch/powerpc/sysdev/uic.c11
13 files changed, 41 insertions, 66 deletions
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 */
50cpm8xx_t *cpmp; /* Pointer to comm processor space */ 50cpm8xx_t *cpmp; /* Pointer to comm processor space */
51cpic8xx_t *cpic_reg; 51cpic8xx_t *cpic_reg;
52 52
53static struct device_node *cpm_pic_node;
54static struct irq_host *cpm_pic_host; 53static struct irq_host *cpm_pic_host;
55 54
56static void cpm_mask_irq(unsigned int irq) 55static void cpm_mask_irq(unsigned int irq)
@@ -97,7 +96,7 @@ int cpm_get_irq(void)
97 96
98static int cpm_pic_host_match(struct irq_host *h, struct device_node *node) 97static 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
103static int cpm_pic_host_map(struct irq_host *h, unsigned int virq, 102static 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
51static intctl_cpm2_t *cpm2_intctl; 51static intctl_cpm2_t *cpm2_intctl;
52 52
53static struct device_node *cpm2_pic_node;
54static struct irq_host *cpm2_pic_host; 53static struct irq_host *cpm2_pic_host;
55#define NR_MASK_WORDS ((NR_IRQS + 31) / 32) 54#define NR_MASK_WORDS ((NR_IRQS + 31) / 32)
56static unsigned long ppc_cached_irq_mask[NR_MASK_WORDS]; 55static unsigned long ppc_cached_irq_mask[NR_MASK_WORDS];
@@ -208,7 +207,7 @@ unsigned int cpm2_get_irq(void)
208 207
209static int cpm2_pic_host_match(struct irq_host *h, struct device_node *node) 208static 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
214static int cpm2_pic_host_map(struct irq_host *h, unsigned int virq, 213static 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
26static DEFINE_SPINLOCK(i8259_lock); 26static DEFINE_SPINLOCK(i8259_lock);
27 27
28static struct device_node *i8259_node;
29static struct irq_host *i8259_host; 28static struct irq_host *i8259_host;
30 29
31/* 30/*
@@ -165,7 +164,7 @@ static struct resource pic_edgectrl_iores = {
165 164
166static int i8259_host_match(struct irq_host *h, struct device_node *node) 165static 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
171static int i8259_host_map(struct irq_host *h, unsigned int virq, 170static 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
512static int ipic_host_match(struct irq_host *h, struct device_node *node) 512static 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
520static int ipic_host_map(struct irq_host *h, unsigned int virq, 518static 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
56struct ipic_info { 53struct 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
20extern int cpm_get_irq(struct pt_regs *regs); 20extern int cpm_get_irq(struct pt_regs *regs);
21 21
22static struct device_node *mpc8xx_pic_node;
23static struct irq_host *mpc8xx_pic_host; 22static struct irq_host *mpc8xx_pic_host;
24#define NR_MASK_WORDS ((NR_IRQS + 31) / 32) 23#define NR_MASK_WORDS ((NR_IRQS + 31) / 32)
25static unsigned long ppc_cached_irq_mask[NR_MASK_WORDS]; 24static unsigned long ppc_cached_irq_mask[NR_MASK_WORDS];
@@ -122,7 +121,7 @@ unsigned int mpc8xx_get_irq(void)
122 121
123static int mpc8xx_pic_host_match(struct irq_host *h, struct device_node *node) 122static 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
128static int mpc8xx_pic_host_map(struct irq_host *h, unsigned int virq, 127static 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
195out:
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
862static int mpic_host_match(struct irq_host *h, struct device_node *node) 862static 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
870static int mpic_host_map(struct irq_host *h, unsigned int virq, 868static 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
205static int mv64x60_host_match(struct irq_host *h, struct device_node *np) 205static 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
210static struct irq_chip *mv64x60_chips[] = { 210static 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
246static int qe_ic_host_match(struct irq_host *h, struct device_node *node) 246static 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
254static int qe_ic_host_map(struct irq_host *h, unsigned int virq, 252static 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 @@
52u32 tsi108_pci_cfg_base; 52u32 tsi108_pci_cfg_base;
53static u32 tsi108_pci_cfg_phys; 53static u32 tsi108_pci_cfg_phys;
54u32 tsi108_csr_vir_base; 54u32 tsi108_csr_vir_base;
55static struct device_node *pci_irq_node;
56static struct irq_host *pci_irq_host; 55static struct irq_host *pci_irq_host;
57 56
58extern u32 get_vir_csrbase(void); 57extern u32 get_vir_csrbase(void);
@@ -407,7 +406,7 @@ static int pci_irq_host_map(struct irq_host *h, unsigned int virq,
407 406
408static int pci_irq_host_match(struct irq_host *h, struct device_node *node) 407static 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
413static struct irq_host_ops pci_irq_host_ops = { 412static 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
64static void uic_unmask_irq(unsigned int virq) 61static void uic_unmask_irq(unsigned int virq)
@@ -220,8 +217,7 @@ out_unlock:
220 217
221static int uic_host_match(struct irq_host *h, struct device_node *node) 218static 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
227static int uic_host_map(struct irq_host *h, unsigned int virq, 223static 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? */