[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191129101542.drtcn44twcyzxqmm@pengutronix.de>
Date: Fri, 29 Nov 2019 11:15:42 +0100
From: Marco Felsch <m.felsch@...gutronix.de>
To: Linus Walleij <linus.walleij@...aro.org>
Cc: Bartosz Golaszewski <bgolaszewski@...libre.com>,
Support Opensource <support.opensource@...semi.com>,
Lee Jones <lee.jones@...aro.org>,
Rob Herring <robh+dt@...nel.org>,
Liam Girdwood <lgirdwood@...il.com>,
Mark Brown <broonie@...nel.org>, stwiss.opensource@...semi.com,
Adam Thomson <Adam.Thomson.Opensource@...semi.com>,
"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS"
<devicetree@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Sascha Hauer <kernel@...gutronix.de>
Subject: Re: [PATCH v2 1/5] gpio: add support to get local gpio number
Hi Linus,
On 19-11-29 10:32, Linus Walleij wrote:
> Hi Marco,
>
> thanks for your patch!
>
> On Wed, Nov 27, 2019 at 2:59 PM Marco Felsch <m.felsch@...gutronix.de> wrote:
>
> > Sometimes consumers needs to know the gpio-chip local gpio number of a
> > 'struct gpio_desc' for further configuration. This is often the case for
> > mfd devices.
> >
> > Signed-off-by: Marco Felsch <m.felsch@...gutronix.de>
> (...)
> > +int gpiod_to_offset(struct gpio_desc *desc)
> > +{
> > + return gpio_chip_hwgpio(desc);
> > +}
> > +EXPORT_SYMBOL_GPL(gpiod_to_offset);
>
> That seems like an unnecessary wrapper.
I went this way due to minimal changes..
> What about renaming gpio_chip_hwgpio() everywhere
> to gpiod_to_offet(), remove it from drivers/gpio/gpiolib.h
> and export it in <linux/gpio/consumer.h> instead?
That's also possible but then we have to include the consumer.h header
within the gpiolib.c and this seems to be wrong. But since I'm not the
maintainer it is up to you and Bart. Both ways are possible,
> I suppose this is what Bartosz is indicating, not sure though.
>
> Indeed it is a bit of a worrysome thing to export and we need
> to be very specific about its usecase, so I'd also like some
> nice to-the-point kerneldoc on the export site so that it is
> clear what corner cases this function is for. (Like in this
> specific driver.)
Absolutly, I missed the kerneldoc.. but where should I put the kerneldoc
if we go the 'wrapper'-way?
Regards,
Marco
> Yours,
> Linus Walleij
>
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
Powered by blists - more mailing lists