Re: [PATCH 1/2] gpiolib: Add for_each_gpio_suffix() helper

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Aug 14, 2019 at 03:17:44PM +0200, Stefan Roese wrote:
> On 14.08.19 10:48, Linus Walleij wrote:
> > On Mon, Aug 12, 2019 at 1:18 PM Geert Uytterhoeven <geert@xxxxxxxxxxxxxx> wrote:
> > > On Sat, Aug 10, 2019 at 10:27 AM Linus Walleij <linus.walleij@xxxxxxxxxx> wrote:
> > > > On Thu, Aug 8, 2019 at 3:25 PM Stefan Roese <sr@xxxxxxx> wrote:
> > > > > Add a helper macro to enable the interation over all supported GPIO
> > > > > suffixes (currently "gpios" & "gpio"). This will be used by the serial
> > > > > mctrl code to check, if a GPIO property exists before requesting it.
> > > > > 
> > > > > Signed-off-by: Stefan Roese <sr@xxxxxxx>
> > > > > Suggested-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
> > > > > Cc: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
> > > > > Cc: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>
> > > > > Cc: Pavel Machek <pavel@xxxxxxx>
> > > > > Cc: Linus Walleij <linus.walleij@xxxxxxxxxx>
> > > > > Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
> > > > 
> > > > I really like this patch, it makes things so much more readable.
> > > 
> > > Do we really need to spread this *-gpio" legacy support all over the kernel?
> > 
> > Not really :/
> > 
> > Isn't it possible to use something like gpiod_count(dev, "foo") to
> > check for any GPIOs instead?
> 
> Good idea. I can rework my patch to use gpiod_count() to check if the
> GPIO exists before requesting it. This way, we're not spreading the
> legacy "-gpio" support any more.
> 
> But I'm unsure, if I should change the string malloc (kasprintf) to the
> fixed length string on the stack as I've done in this patch version.

You don't need suffix for gpiod_count(). Will you need that at all?

-- 
With Best Regards,
Andy Shevchenko





[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux