From: Arnd Bergmann <arnd@arndb.de>
To: linux-arm-kernel@lists.infradead.org
Cc: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
"Thomas Gleixner" <tglx@linutronix.de>,
"Jonathan Austin" <jonathan.austin@arm.com>,
"Catalin Marinas" <catalin.marinas@arm.com>,
kernel@pengutronix.de, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] irqchip: Add support for ARMv7-M's NVIC
Date: Thu, 28 Mar 2013 22:32:42 +0000 [thread overview]
Message-ID: <201303282232.42955.arnd@arndb.de> (raw)
In-Reply-To: <1363612826-15623-1-git-send-email-u.kleine-koenig@pengutronix.de>
On Monday 18 March 2013, Uwe Kleine-König wrote:
> +static int __init nvic_init_bases(struct device_node *node,
> + void __iomem *nvic_base)
> +{
There is probably no point to keep this function separate from
nvic_of_init any more, unless you plan to mke it globally
accessible and called from non-DT platforms. In that case
you would need an irq_base argument though.
> + irq_base = irq_alloc_descs_from(16, irqs, numa_node_id());
> + if (irq_base < 0) {
> + pr_warn("Cannot allocate irq_descs\n");
> + ret = irq_base;
> + goto err_irq_alloc_descs;
> + }
> + if (irq_base != 16) {
> + /*
> + * The entry code just passes the exception number (i.e. irq
> + * number + 16) to asm_do_IRQ, so the offset needs to be fixed
> + * here.
> + */
> + pr_warn("Failed to allocate irq_descs at offset 16\n");
> + goto err_wrong_irq_base;
> + }
> +
> + irq_domain = irq_domain_add_legacy(node, irqs, irq_base, 0,
> + &irq_domain_simple_ops, NULL);
Why do you use a legacy domain here, and hardcode the irq_base?
For a fully DT-enabled platform, the base should not matter and you
can use irq_domain_add_linear, while a legacy platform would likely
need a different base.
> +static int __init nvic_of_init(struct device_node *node,
> + struct device_node *parent)
> +{
> + void __iomem *nvic_base;
> +
> + if (!node)
> + return -ENODEV;
As Thomas commented, the check for !node is pointless here.
Arnd
prev parent reply other threads:[~2013-03-28 22:33 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-12 15:54 [PATCH] irqchip: Add support for ARMv7-M's NVIC Uwe Kleine-König
2013-03-12 16:01 ` Russell King - ARM Linux
2013-03-12 19:27 ` Uwe Kleine-König
2013-03-12 20:13 ` Russell King - ARM Linux
2013-03-12 19:57 ` Thomas Gleixner
2013-03-12 20:47 ` Uwe Kleine-König
2013-03-12 21:40 ` Thomas Gleixner
2013-03-18 13:20 ` [PATCH v2] " Uwe Kleine-König
2013-03-28 13:28 ` Uwe Kleine-König
2013-03-28 22:32 ` Arnd Bergmann [this message]
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=201303282232.42955.arnd@arndb.de \
--to=arnd@arndb.de \
--cc=catalin.marinas@arm.com \
--cc=jonathan.austin@arm.com \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=u.kleine-koenig@pengutronix.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox