From: Paul Mundt <lethal@linux-sh.org>
To: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: Linus Walleij <linus.walleij@stericsson.com>,
Grant Likely <grant.likely@secretlab.ca>,
Kuninori Morimoto <kuninori.morimoto.gx@gmail.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2][resend] gpio: pcf857x: enable gpio_to_irq() support
Date: Thu, 14 Jun 2012 15:15:19 +0900 [thread overview]
Message-ID: <20120614061519.GB22007@linux-sh.org> (raw)
In-Reply-To: <87aa06qykw.wl%kuninori.morimoto.gx@renesas.com>
On Wed, Jun 13, 2012 at 09:58:26PM -0700, Kuninori Morimoto wrote:
> +static void pcf857x_nothing(struct irq_data *data)
> +{
> + /* do nothing */
> +}
> +
> +static struct irq_chip pcf857x_irq_chip = {
> + .name = "pcf857x cascade",
> + .irq_mask = pcf857x_nothing,
> + .irq_unmask = pcf857x_nothing,
> +};
> +
Just use dummy_irq_chip.
> +static int pcf857x_irq_domain_init(struct pcf857x *gpio,
> + struct pcf857x_platform_data *pdata,
> + struct device *dev)
> +{
> + int status;
> +
> + /* create demuxed irq */
> + gpio->irq_demux_base = irq_alloc_descs(-1, 0, gpio->chip.ngpio, 0);
> + if (gpio->irq_demux_base < 0)
> + return -ENODEV;
> +
> + gpio->irq_domain = irq_domain_add_legacy(dev->of_node,
> + gpio->chip.ngpio,
> + gpio->irq_demux_base,
> + 0,
> + &pcf857x_irq_domain_ops,
> + NULL);
Given that you don't actually care where the IRQs are mapped there's no
need to bother with a legacy domain here, you can just use a linear one
outright. At which point you can drop your separate irq_desc
allocation/management.
next prev parent reply other threads:[~2012-06-14 6:15 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <877gw2uis5.wl%kuninori.morimoto.gx@renesas.com>
2012-06-14 4:57 ` [PATCH 0/2][resend] gpio: pcf857x: enable gpio_to_irq() Kuninori Morimoto
2012-06-14 4:58 ` [PATCH 1/2][resend] gpio: pcf857x: share 8/16 bit access functions Kuninori Morimoto
2012-07-05 12:57 ` Linus Walleij
2012-06-14 4:58 ` [PATCH 2/2][resend] gpio: pcf857x: enable gpio_to_irq() support Kuninori Morimoto
2012-06-14 6:15 ` Paul Mundt [this message]
2012-06-14 7:06 ` Kuninori Morimoto
2012-06-14 7:10 ` [PATCH 2/2 v2][resend] " Kuninori Morimoto
2012-06-14 7:23 ` Paul Mundt
2012-06-14 7:59 ` Kuninori Morimoto
2012-06-15 2:40 ` [PATCH 2/2 v3][resend] " Kuninori Morimoto
2012-07-05 13: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=20120614061519.GB22007@linux-sh.org \
--to=lethal@linux-sh.org \
--cc=grant.likely@secretlab.ca \
--cc=kuninori.morimoto.gx@gmail.com \
--cc=kuninori.morimoto.gx@renesas.com \
--cc=linus.walleij@stericsson.com \
--cc=linux-kernel@vger.kernel.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