On Fri, Jun 15, 2018 at 1:41 AM Benjamin Herrenschmidt <benh@xxxxxxxxxxxxxxxxxxx> wrote: > On Thu, 2018-06-14 at 10:59 +0200, Linus Walleij wrote: > > > > Overall looks fine! > > > > You definately need something like this for handling this special case. > > > > > +#include <linux/gpio/consumer.h> > > > > Why do you need this? > > > > I don't see that you use any functions from it. > > > > > +#include "gpiolib.h" > > > > I'm not so happy about this either, what is this needed for? > > > > It seems to me you can remove both includes, but admittedly I miss > > fine details all the time. > > I wish I could :-) This is the main wart in there to be honest. > > consumer.h is needed to build gpiolib.h > > gpiolib.h is needed for gpio_chip_hwgpio() which needs the definition > of gpio_desc, etc... Aha I see, you need that because while normally the gpiolib does the conversion of desc -> offset this is needed here in a driver. Maybe we should just name it gpiod_to_offset() or something and make it a public API. But this is actually OK, you definately need it here, toss in some comment or so about what is going on and why this is included so we know in the future. 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