|
@@ -63,7 +63,6 @@ enum {
|
|
|
|
|
|
struct spider_pic {
|
|
|
struct irq_host *host;
|
|
|
- struct device_node *of_node;
|
|
|
void __iomem *regs;
|
|
|
unsigned int node_id;
|
|
|
};
|
|
@@ -178,8 +177,7 @@ static struct irq_chip spider_pic = {
|
|
|
|
|
|
static int spider_host_match(struct irq_host *h, struct device_node *node)
|
|
|
{
|
|
|
- struct spider_pic *pic = h->host_data;
|
|
|
- return node == pic->of_node;
|
|
|
+ return h->of_node == node;
|
|
|
}
|
|
|
|
|
|
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)
|
|
|
* tree in case the device-tree is ever fixed
|
|
|
*/
|
|
|
struct of_irq oirq;
|
|
|
- if (of_irq_map_one(pic->of_node, 0, &oirq) == 0) {
|
|
|
+ if (of_irq_map_one(pic->host->of_node, 0, &oirq) == 0) {
|
|
|
virq = irq_create_of_mapping(oirq.controller, oirq.specifier,
|
|
|
oirq.size);
|
|
|
return virq;
|
|
|
}
|
|
|
|
|
|
/* Now do the horrible hacks */
|
|
|
- tmp = of_get_property(pic->of_node, "#interrupt-cells", NULL);
|
|
|
+ tmp = of_get_property(pic->host->of_node, "#interrupt-cells", NULL);
|
|
|
if (tmp == NULL)
|
|
|
return NO_IRQ;
|
|
|
intsize = *tmp;
|
|
|
- imap = of_get_property(pic->of_node, "interrupt-map", &imaplen);
|
|
|
+ imap = of_get_property(pic->host->of_node, "interrupt-map", &imaplen);
|
|
|
if (imap == NULL || imaplen < (intsize + 1))
|
|
|
return NO_IRQ;
|
|
|
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,
|
|
|
panic("spider_pic: can't map registers !");
|
|
|
|
|
|
/* Allocate a host */
|
|
|
- pic->host = irq_alloc_host(IRQ_HOST_MAP_LINEAR, SPIDER_SRC_COUNT,
|
|
|
- &spider_host_ops, SPIDER_IRQ_INVALID);
|
|
|
+ pic->host = irq_alloc_host(of_node_get(of_node), IRQ_HOST_MAP_LINEAR,
|
|
|
+ SPIDER_SRC_COUNT, &spider_host_ops,
|
|
|
+ SPIDER_IRQ_INVALID);
|
|
|
if (pic->host == NULL)
|
|
|
panic("spider_pic: can't allocate irq host !");
|
|
|
pic->host->host_data = pic;
|
|
|
|
|
|
- /* Fill out other bits */
|
|
|
- pic->of_node = of_node_get(of_node);
|
|
|
-
|
|
|
/* Go through all sources and disable them */
|
|
|
for (i = 0; i < SPIDER_SRC_COUNT; i++) {
|
|
|
void __iomem *cfg = pic->regs + TIR_CFGA + 8 * i;
|