lkml.org 
[lkml]   [2012]   [Jun]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2][resend] gpio: pcf857x: enable gpio_to_irq() support
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.


\
 
 \ /
  Last update: 2012-06-14 09:01    [W:0.084 / U:0.920 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site