From dfaf820a13ec160f06556e08dab423818ba87f14 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Mon, 6 May 2013 17:03:32 +0800 Subject: [PATCH 1/2] irqchip: renesas-irqc: Fix irqc_probe error handling The code in goto err3 path is wrong because it will call fee_irq() with k == 0, which means it does free_irq(p->irq[-1].requested_irq, &p->irq[-1]); Signed-off-by: Axel Lin Signed-off-by: Simon Horman --- drivers/irqchip/irq-renesas-irqc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/irqchip/irq-renesas-irqc.c b/drivers/irqchip/irq-renesas-irqc.c index 927bff373aac..2f404ba61c6c 100644 --- a/drivers/irqchip/irq-renesas-irqc.c +++ b/drivers/irqchip/irq-renesas-irqc.c @@ -248,8 +248,8 @@ static int irqc_probe(struct platform_device *pdev) return 0; err3: - for (; k >= 0; k--) - free_irq(p->irq[k - 1].requested_irq, &p->irq[k - 1]); + while (--k >= 0) + free_irq(p->irq[k].requested_irq, &p->irq[k]); irq_domain_remove(p->irq_domain); err2: From 0d7c1210992ff05ee8de5d2c790defded3856f29 Mon Sep 17 00:00:00 2001 From: Bastian Hecht Date: Wed, 8 May 2013 15:20:04 +0200 Subject: [PATCH 2/2] irqchip: Add irqchip_init dummy function We add an empty irqchip_init dummy function for cases in which CONFIG_IRQCHIP is not used. In these cases irqchip.c is not compiled, but a funtion call may still be present in architecture code, that in runtime doesn't get hit. E.g. this is needed in the arch/arm/mach-shmobile/intc-r8a7740.c interrupt setup code where OF use and non OF us is both handled in one file. Signed-off-by: Bastian Hecht [horms+renesas@verge.net.au: Make non-CONFIG_IRQCHIP version static inline and remove trailing ';'.] Signed-off-by: Simon Horman --- include/linux/irqchip.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/linux/irqchip.h b/include/linux/irqchip.h index e0006f1d35a0..14d79131f53d 100644 --- a/include/linux/irqchip.h +++ b/include/linux/irqchip.h @@ -11,6 +11,10 @@ #ifndef _LINUX_IRQCHIP_H #define _LINUX_IRQCHIP_H +#ifdef CONFIG_IRQCHIP void irqchip_init(void); +#else +static inline void irqchip_init(void) {} +#endif #endif