lkml.org 
[lkml]   [2020]   [Jun]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 2/2] gpio: aggregator: Use bitmap_parselist() for parsing GPIO offsets
On Wed, Jun 24, 2020 at 3:16 PM Bartosz Golaszewski
<bgolaszewski@baylibre.com> wrote:
>
> wt., 23 cze 2020 o 16:57 Geert Uytterhoeven <geert+renesas@glider.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@gmail.com>
> > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.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?

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.

--
With Best Regards,
Andy Shevchenko

\
 
 \ /
  Last update: 2020-06-24 15:42    [W:0.074 / U:0.944 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site