From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v6 05/11] irqchip: mmp: avoid to include irqs head file
Date: Fri, 26 Jul 2013 18:10:31 +0200 [thread overview]
Message-ID: <201307261810.32069.arnd@arndb.de> (raw)
In-Reply-To: <1374833133-21119-6-git-send-email-haojian.zhuang@gmail.com>
On Friday 26 July 2013, Haojian Zhuang wrote:
> Since <mach/irqs.h> in irq-mmp.c blocks the multiplatform build,
> remove it instead.
>
> Signed-off-by: Haojian Zhuang <haojian.zhuang@gmail.com>
> ---
> drivers/irqchip/irq-mmp.c | 45 +++++++++++++++++++++------------------------
> 1 file changed, 21 insertions(+), 24 deletions(-)
The intention behind this patch is good, but I think the implementation is
bad, since the platform still relies on specific hardcoded values for
the base irq numbers. As long as this is the case, you should use the
constants.
> @@ -249,7 +247,7 @@ void __init icu_init_irq(void)
> /* MMP2 (ARMv7) */
> void __init mmp2_init_icu(void)
> {
> - int irq;
> + int irq, end;
>
> max_icu_nr = 8;
> mmp_icu_base = ioremap(0xd4282000, 0x1000);
> @@ -263,11 +261,12 @@ void __init (void)
> &icu_data[0]);
> icu_data[1].reg_status = mmp_icu_base + 0x150;
> icu_data[1].reg_mask = mmp_icu_base + 0x168;
> - icu_data[1].clr_mfp_irq_base = IRQ_MMP2_PMIC_BASE;
> - icu_data[1].clr_mfp_hwirq = IRQ_MMP2_PMIC - IRQ_MMP2_PMIC_BASE;
> + icu_data[1].clr_mfp_irq_base = icu_data[0].virq_base +
> + icu_data[0].nr_irqs;
> + icu_data[1].clr_mfp_hwirq = 1; /* offset to IRQ_MMP2_PMIC_BASE */
> icu_data[1].nr_irqs = 2;
> icu_data[1].cascade_irq = 4;
> - icu_data[1].virq_base = IRQ_MMP2_PMIC_BASE;
> + icu_data[1].virq_base = icu_data[0].virq_base + icu_data[0].nr_irqs;
> icu_data[1].domain = irq_domain_add_legacy(NULL, icu_data[1].nr_irqs,
> icu_data[1].virq_base, 0,
> &irq_domain_simple_ops,
I'd suggest passing IRQ_MMP2_PMIC_BASE and the other constants from the caller
and changing the prototype accordingly so you can do
mmp2_init_icu(0, IRQ_MMP2_PMIC_BASE, IRQ_MMP2_RTC_BASE, IRQ_MMP2_KEYPAD_BASE,
IRQ_MMP2_TWSI_BASE, IRQ_MMP2_MISC_BASE, IRQ_MMP2_MIPI_HSI1_BASE,
IRQ_MMP2_MIPI_HSI0_BASE);
Arnd
next prev parent reply other threads:[~2013-07-26 16:10 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-26 10:05 No subject Haojian Zhuang
2013-07-26 10:05 ` [PATCH v6 01/11] irqchip: move mmp irq driver Haojian Zhuang
2013-08-14 21:26 ` Daniel Drake
2013-08-21 20:27 ` Daniel Drake
2013-08-22 1:28 ` Haojian Zhuang
2013-07-26 10:05 ` [PATCH v6 02/11] irqchip: mmp: support irqchip Haojian Zhuang
2013-08-12 22:53 ` Daniel Drake
2013-08-13 22:53 ` Daniel Drake
2013-08-14 17:47 ` Daniel Drake
2013-07-26 10:05 ` [PATCH v6 03/11] irqchip: mmp: support MULTI_IRQ_HANDLER Haojian Zhuang
2013-07-26 10:05 ` [PATCH v6 04/11] ARM: mmp: avoid to include head file in mach-mmp Haojian Zhuang
2013-08-14 18:56 ` Daniel Drake
2013-08-24 9:45 ` Haojian Zhuang
2013-07-26 10:05 ` [PATCH v6 05/11] irqchip: mmp: avoid to include irqs head file Haojian Zhuang
2013-07-26 16:10 ` Arnd Bergmann [this message]
2013-07-26 10:05 ` [PATCH v6 06/11] clocksource: mmp: move mmp timer driver Haojian Zhuang
2013-08-14 19:22 ` Daniel Drake
2013-07-26 10:05 ` [PATCH v6 07/11] ARM: mmp: move timer registers into driver Haojian Zhuang
2013-08-14 19:37 ` Daniel Drake
2013-07-26 10:05 ` [PATCH v6 08/11] ARM: pxa: init dma debugfs in late level Haojian Zhuang
2013-08-10 17:29 ` Daniel Mack
2013-08-11 4:53 ` Haojian Zhuang
2013-07-26 10:05 ` [PATCH v6 09/11] clk: mmp: parse clock from dts Haojian Zhuang
2013-08-09 16:04 ` Mark Rutland
2013-08-10 11:06 ` Tomasz Figa
2013-08-10 12:31 ` Mark Rutland
2013-08-10 12:34 ` Tomasz Figa
2013-08-10 14:57 ` Daniel Drake
2013-08-11 5:22 ` Haojian Zhuang
2013-08-14 21:25 ` Daniel Drake
2013-07-26 10:05 ` [PATCH v6 10/11] ARM: dts: support common clock in arch mmp Haojian Zhuang
2013-07-26 10:05 ` [PATCH v6 11/11] ARM: mmp: avoid to use cpu_is_xxx in timer Haojian Zhuang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201307261810.32069.arnd@arndb.de \
--to=arnd@arndb.de \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.