[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAMuHMdWR5=3UZuWx5hRe8YmxX6Xj2mCxJsT2kKjVceqVYY3SZA@mail.gmail.com>
Date: Sat, 27 Jun 2020 09:57:58 +0200
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: Andy Shevchenko <andy.shevchenko@...il.com>
Cc: Bartosz Golaszewski <bgolaszewski@...libre.com>,
Linus Walleij <linus.walleij@...aro.org>,
linux-gpio <linux-gpio@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/2] gpio: aggregator: Use bitmap_parselist() for parsing
GPIO offsets
Hi Andy,
On Wed, Jun 24, 2020 at 3:41 PM Andy Shevchenko
<andy.shevchenko@...il.com> wrote:
> On Wed, Jun 24, 2020 at 3:16 PM Bartosz Golaszewski
> <bgolaszewski@...libre.com> wrote:
> > wt., 23 cze 2020 o 16:57 Geert Uytterhoeven <geert+renesas@...der.be>
> > napisaĆ(a):
> > >
> > > Replace the custom code to parse GPIO offsets and/or GPIO offset ranges
> > > by a call to bitmap_parselist(), and an iteration over the returned bit
> > > mask.
> > >
> > > This should have no impact on the format of the configuration parameters
> > > written to the "new_device" virtual file in sysfs.
> > >
> > > Suggested-by: Andy Shevchenko <andy.shevchenko@...il.com>
> > > Signed-off-by: Geert Uytterhoeven <geert+renesas@...der.be>
> > > ---
> > > I'm not super happy with the mask[] array, which is on the stack.
> > > But there is no real limit on the number of GPIO lines provided by a
> > > single gpiochip, except for the global ARCH_NR_GPIOS.
> >
> > Why not allocate it with bitmap_zalloc() then?
Bartosz: Thanks, good idea!
> I haven't got the original messages yet, so my thought is to actually
> extract a helper from
> gpiod_get_array_value_complex() or gpiod_set_array_value_complex() for
> bitmap allocation.
> But I didn't check if it's suitable here. So, bitmap_zalloc() would be helpful.
/me confused
This function is not about getting/setting multiple GPIO lines in a gpiochip,
but about parsing a list of numbers and ranges. No gpiochip is involved.
original message:
https://lore.kernel.org/r/20200623145748.28877-3-geert+renesas@glider.be
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Powered by blists - more mailing lists