From: robherring2@gmail.com (Rob Herring)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: VIC: use irq_domain_add_simple()
Date: Tue, 16 Oct 2012 08:32:23 -0500 [thread overview]
Message-ID: <507D61E7.2080704@gmail.com> (raw)
In-Reply-To: <1350392786-29191-1-git-send-email-linus.walleij@stericsson.com>
On 10/16/2012 08:06 AM, Linus Walleij wrote:
> From: Linus Walleij <linus.walleij@linaro.org>
>
> Instead of allocating descriptors on-the-fly for the device tree
> initialization case, use irq_domain_add_simple() which will take
> care of this if you pass negative as the first_irq.
>
> Alter the signature of __vic_init() to pass the first_irq as
> signed so this works as expected.
>
> Switching the VIC to use irq_domain_add_simple() also has the
> upside of displaying the same WARNING when you boot with
> pre-allocated descriptors on systems using SPARSE_IRQ but
> yet not using device tree.
>
> Cc: Rob Herring <rob.herring@calxeda.com>
> Cc: Grant Likely <grant.likely@secretlab.ca>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Rob Herring <rob.herring@calxeda.com>
Rob
> ---
> arch/arm/common/vic.c | 18 ++++++------------
> arch/arm/include/asm/hardware/vic.h | 2 +-
> 2 files changed, 7 insertions(+), 13 deletions(-)
>
> diff --git a/arch/arm/common/vic.c b/arch/arm/common/vic.c
> index e0d5388..4fd5d98 100644
> --- a/arch/arm/common/vic.c
> +++ b/arch/arm/common/vic.c
> @@ -218,7 +218,7 @@ static void __init vic_register(void __iomem *base, unsigned int irq,
> v->resume_sources = resume_sources;
> v->irq = irq;
> vic_id++;
> - v->domain = irq_domain_add_legacy(node, fls(valid_sources), irq, 0,
> + v->domain = irq_domain_add_simple(node, fls(valid_sources), irq,
> &vic_irqdomain_ops, v);
> }
>
> @@ -350,7 +350,7 @@ static void __init vic_init_st(void __iomem *base, unsigned int irq_start,
> vic_register(base, irq_start, vic_sources, 0, node);
> }
>
> -void __init __vic_init(void __iomem *base, unsigned int irq_start,
> +void __init __vic_init(void __iomem *base, int irq_start,
> u32 vic_sources, u32 resume_sources,
> struct device_node *node)
> {
> @@ -416,18 +416,12 @@ int __init vic_of_init(struct device_node *node, struct device_node *parent)
> if (WARN_ON(!regs))
> return -EIO;
>
> - irq_base = irq_alloc_descs(-1, 0, 32, numa_node_id());
> - if (WARN_ON(irq_base < 0))
> - goto out_unmap;
> -
> - __vic_init(regs, irq_base, ~0, ~0, node);
> + /*
> + * Passing -1 as first IRQ makes the simple domain allocate descriptors
> + */
> + __vic_init(regs, -1, ~0, ~0, node);
>
> return 0;
> -
> - out_unmap:
> - iounmap(regs);
> -
> - return -EIO;
> }
> #endif /* CONFIG OF */
>
> diff --git a/arch/arm/include/asm/hardware/vic.h b/arch/arm/include/asm/hardware/vic.h
> index e14af1a..2bebad3 100644
> --- a/arch/arm/include/asm/hardware/vic.h
> +++ b/arch/arm/include/asm/hardware/vic.h
> @@ -47,7 +47,7 @@
> struct device_node;
> struct pt_regs;
>
> -void __vic_init(void __iomem *base, unsigned int irq_start, u32 vic_sources,
> +void __vic_init(void __iomem *base, int irq_start, u32 vic_sources,
> u32 resume_sources, struct device_node *node);
> void vic_init(void __iomem *base, unsigned int irq_start, u32 vic_sources, u32 resume_sources);
> int vic_of_init(struct device_node *node, struct device_node *parent);
>
next prev parent reply other threads:[~2012-10-16 13:32 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-16 13:06 [PATCH] ARM: VIC: use irq_domain_add_simple() Linus Walleij
2012-10-16 13:32 ` Rob Herring [this message]
2012-12-18 23:34 ` Grant Likely
2012-12-20 18:45 ` Linus Walleij
2012-12-26 0:43 ` Linus Walleij
2013-01-11 18:57 ` Grant Likely
2013-01-11 20:38 ` Linus Walleij
2012-11-08 13:40 ` [PATCH] ARM: VIC: remove unused irq_base variable Arnd Bergmann
2012-11-08 13:55 ` Russell King - ARM Linux
2012-11-08 14:00 ` Linus Walleij
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=507D61E7.2080704@gmail.com \
--to=robherring2@gmail.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).