[PATCH v3 10/12] gpio: pxa: add irq base in platform data
Haojian Zhuang
haojian.zhuang at linaro.org
Thu Feb 21 20:34:11 EST 2013
On 22 February 2013 03:12, Linus Walleij <linus.walleij at linaro.org> wrote:
> On Mon, Feb 18, 2013 at 6:12 AM, Haojian Zhuang
> <haojian.zhuang at linaro.org> wrote:
>
>> Macro PXA_GPIO_TO_IRQ() & MMP_GPIO_TO_IRQ() is used in machine driver
>> without DT. Although we're allocating irq descriptions dynamically,
>> it may break machine drivers without DT. Append pdata->irq_base.
>> If irq_base is valid, allocate irq descriptions from irq_base.
>>
>> Signed-off-by: Haojian Zhuang <haojian.zhuang at linaro.org>
> (...)
>> - chips[i].irq_base = irq_alloc_descs(-1, 0, gc->ngpio, 0);
>> + if (pdata->irq_base)
>> + irq_base = pdata->irq_base + gpio;
>> + else
>> + irq_base = -1;
>> + chips[i].irq_base = irq_alloc_descs(irq_base, 0, gc->ngpio, 0);
>> if (chips[i].irq_base < 0)
>> return -EINVAL;
>> if (!irq_domain_add_legacy(pdev->dev.of_node, gc->ngpio,
>
> In this case, when you want to pass a base IRQ, use
> irq_domain_add_simple().
>
> The descriptor allocation will still be unnecessary.
>
> Yours,
> Linus Walleij
Yes, thank you. Let me clean the irq usage after this patch series.
Regards
Haojian
More information about the linux-arm-kernel
mailing list