On Tue, Mar 18, 2014 at 10:34 AM, Thomas Gleixner <tglx@xxxxxxxxxxxxx> wrote: > So you need a per chip function because all chips have their own > private data struct in irq_chip_data. Sigh. Yeah that's it basically. I was trying to think of a way to proceed to push the irqchip handling into some generic functions in the gpiolib core as you suggested but haven't come up with a good way yet. > It'd be nice if we'd have gpio in the data, so you could have a > generic function which does the right thing. > > In principle it'd be simple. > > struct gpio *gpio = irq_data_get_irq_chip_data(data); > struct adnp *adnp = container_of(gpio, struct adnp, gpio); > > Ditto for all other drivers. But that requires a major overhaul. But hm, it could save a lot of code in single lines all over the place still. Let me try this on one driver and see how this looks. As it seems it can be done in a one-at-a-time manner it should be doable, just some work. > I wonder if it'd be worth to add another pointer to irq_data for such > purposes. The worrying thing would be that .chip_data can easily be confused for this pointer so it needs a catchy name so it's intuitive to see what it is for. But the above solution is probably more elegant so let's try that first. Yours, Linus Walleij -- To unsubscribe from this list: send the line "unsubscribe linux-gpio" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html