Re: [PATCH 1/2] gpio: don't override irq_*_resources() callbacks

From: Linus Walleij
Date: Mon Aug 03 2015 - 04:56:23 EST


On Fri, Jul 31, 2015 at 4:54 PM, Grygorii Strashko
<grygorii.strashko@xxxxxx> wrote:
> On 07/31/2015 03:48 PM, Rabin Vincent wrote:

>> + if (!irqchip->irq_request_resources &&
>> + !irqchip->irq_release_resources) {
>> + irqchip->irq_request_resources = gpiochip_irq_reqres;
>> + irqchip->irq_release_resources = gpiochip_irq_relres;
>> + }
>
> I think, it will be better to handle req/rel cases separately.

No, I think that could be dangerous. The semantics of the both
functions are intertwined, if we change something in the core
we may break drivers.

It would be better with a mechanism saying "also do this
on irq_request/release resource" so a secondary vtable
for these two. Where the latter would be optional per-callback.

That way the ETRAXFS does not need to reimplement
irq locking.

I'll see what I can come up with.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/