Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 19fc65b5 authored by Michael Ellerman's avatar Michael Ellerman Committed by Paul Mackerras
Browse files

powerpc: Fix irq_alloc_host() reference counting and callers



When I changed irq_alloc_host() to take an of_node
(52964f87: "Add an optional
device_node pointer to the irq_host"), I botched the reference
counting semantics.

Stephen pointed out that it's irq_alloc_host()'s business if
it needs to take an additional reference to the device_node,
the caller shouldn't need to care.

Signed-off-by: default avatarMichael Ellerman <michael@ellerman.id.au>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent 2272a55f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -498,7 +498,7 @@ struct irq_host *irq_alloc_host(struct device_node *of_node,
	host->revmap_type = revmap_type;
	host->inval_irq = inval_irq;
	host->ops = ops;
	host->of_node = of_node;
	host->of_node = of_node_get(of_node);

	if (host->ops->match == NULL)
		host->ops->match = default_irq_host_match;
+1 −1
Original line number Diff line number Diff line
@@ -365,7 +365,7 @@ static int axon_msi_probe(struct of_device *device,
		goto out_free_fifo;
	}

	msic->irq_host = irq_alloc_host(of_node_get(dn), IRQ_HOST_MAP_NOMAP,
	msic->irq_host = irq_alloc_host(dn, IRQ_HOST_MAP_NOMAP,
					NR_IRQS, &msic_host_ops, 0);
	if (!msic->irq_host) {
		printk(KERN_ERR "axon_msi: couldn't allocate irq_host for %s\n",
+1 −1
Original line number Diff line number Diff line
@@ -300,7 +300,7 @@ 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(of_node_get(of_node), IRQ_HOST_MAP_LINEAR,
	pic->host = irq_alloc_host(of_node, IRQ_HOST_MAP_LINEAR,
				   SPIDER_SRC_COUNT, &spider_host_ops,
				   SPIDER_IRQ_INVALID);
	if (pic->host == NULL)
+1 −1
Original line number Diff line number Diff line
@@ -159,7 +159,7 @@ unsigned int cpm_pic_init(void)

	out_be32(&cpic_reg->cpic_cimr, 0);

	cpm_pic_host = irq_alloc_host(of_node_get(np), IRQ_HOST_MAP_LINEAR,
	cpm_pic_host = irq_alloc_host(np, IRQ_HOST_MAP_LINEAR,
				      64, &cpm_pic_host_ops, 64);
	if (cpm_pic_host == NULL) {
		printk(KERN_ERR "CPM2 PIC: failed to allocate irq host!\n");
+1 −1
Original line number Diff line number Diff line
@@ -266,7 +266,7 @@ void cpm2_pic_init(struct device_node *node)
	out_be32(&cpm2_intctl->ic_scprrl, 0x05309770);

	/* create a legacy host */
	cpm2_pic_host = irq_alloc_host(of_node_get(node), IRQ_HOST_MAP_LINEAR,
	cpm2_pic_host = irq_alloc_host(node, IRQ_HOST_MAP_LINEAR,
				       64, &cpm2_pic_host_ops, 64);
	if (cpm2_pic_host == NULL) {
		printk(KERN_ERR "CPM2 PIC: failed to allocate irq host!\n");
Loading