diff options
Diffstat (limited to 'arch/powerpc/platforms/cell/spider-pic.c')
-rw-r--r-- | arch/powerpc/platforms/cell/spider-pic.c | 18 |
1 files changed, 7 insertions, 11 deletions
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; |