Thread (37 messages) 37 messages, 10 authors, 2025-02-04

Re: [PATCH 01/13] gpiolib: add gpiods_set_array_value_cansleep()

From: Andy Shevchenko <hidden>
Date: 2025-02-02 10:06:57
Also in: linux-gpio, linux-iio, linux-mmc, linux-phy, linux-sound, lkml

On Fri, Jan 31, 2025 at 10:24 PM David Lechner [off-list ref] wrote:
Add a new gpiods_set_array_value_cansleep() helper function with fewer
parameters than gpiod_set_array_value_cansleep().

Calling gpiod_set_array_value_cansleep() can get quite verbose. In many
cases, the first arguments all come from the same struct gpio_descs, so
having a separate function where we can just pass that cuts down on the
boilerplate.
...
+static inline int gpiods_set_array_value_cansleep(struct gpio_descs *descs,
+                                                 unsigned long *value_bitmap)
My proposal was to make this gpiod_set_many_value_cansleep(), but I'm
not pretending it's the best choice.
+{
+       return gpiod_set_array_value_cansleep(descs->ndescs, descs->desc,
+                                             descs->info, value_bitmap);
+}
I don't remember seeing the _bitmap suffix in other GPIO APIs, perhaps
just drop it?

-- 
With Best Regards,
Andy Shevchenko
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help