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

Commit e10fc03c authored by Magnus Damm's avatar Magnus Damm Committed by Thomas Gleixner
Browse files

irqchip/renesas-irqc: Make use of irq_find_mapping()



Instead of locally caching the virq as domain_irq simply rely on the
IRQ domain code and irq_find_mapping().  This reduces the delta
between the IRQC driver and the generic chip implementation.

Signed-off-by: default avatarMagnus Damm <damm+renesas@opensource.se>
Cc: jason@lakedaemon.net
Cc: geert+renesas@glider.be
Cc: horms@verge.net.au
Cc: Magnus Damm <magnus.damm@gmail.com>
Link: http://lkml.kernel.org/r/20150720100635.2552.20906.sendpatchset@little-apple


Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent 7d153751
Loading
Loading
Loading
Loading
+4 −7
Original line number Original line Diff line number Diff line
@@ -53,7 +53,6 @@
struct irqc_irq {
struct irqc_irq {
	int hw_irq;
	int hw_irq;
	int requested_irq;
	int requested_irq;
	int domain_irq;
	struct irqc_priv *p;
	struct irqc_priv *p;
};
};


@@ -70,8 +69,8 @@ struct irqc_priv {


static void irqc_dbg(struct irqc_irq *i, char *str)
static void irqc_dbg(struct irqc_irq *i, char *str)
{
{
	dev_dbg(&i->p->pdev->dev, "%s (%d:%d:%d)\n",
	dev_dbg(&i->p->pdev->dev, "%s (%d:%d)\n",
		str, i->requested_irq, i->hw_irq, i->domain_irq);
		str, i->requested_irq, i->hw_irq);
}
}


static void irqc_irq_enable(struct irq_data *d)
static void irqc_irq_enable(struct irq_data *d)
@@ -145,7 +144,7 @@ static irqreturn_t irqc_irq_handler(int irq, void *dev_id)
	if (ioread32(p->iomem + DETECT_STATUS) & bit) {
	if (ioread32(p->iomem + DETECT_STATUS) & bit) {
		iowrite32(bit, p->iomem + DETECT_STATUS);
		iowrite32(bit, p->iomem + DETECT_STATUS);
		irqc_dbg(i, "demux2");
		irqc_dbg(i, "demux2");
		generic_handle_irq(i->domain_irq);
		generic_handle_irq(irq_find_mapping(p->irq_domain, i->hw_irq));
		return IRQ_HANDLED;
		return IRQ_HANDLED;
	}
	}
	return IRQ_NONE;
	return IRQ_NONE;
@@ -156,9 +155,6 @@ static int irqc_irq_domain_map(struct irq_domain *h, unsigned int virq,
{
{
	struct irqc_priv *p = h->host_data;
	struct irqc_priv *p = h->host_data;


	p->irq[hw].domain_irq = virq;
	p->irq[hw].hw_irq = hw;

	irqc_dbg(&p->irq[hw], "map");
	irqc_dbg(&p->irq[hw], "map");
	irq_set_chip_data(virq, h->host_data);
	irq_set_chip_data(virq, h->host_data);
	irq_set_chip_and_handler(virq, &p->irq_chip, handle_level_irq);
	irq_set_chip_and_handler(virq, &p->irq_chip, handle_level_irq);
@@ -214,6 +210,7 @@ static int irqc_probe(struct platform_device *pdev)
			break;
			break;


		p->irq[k].p = p;
		p->irq[k].p = p;
		p->irq[k].hw_irq = k;
		p->irq[k].requested_irq = irq->start;
		p->irq[k].requested_irq = irq->start;
	}
	}