Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

gpio: max3191x: use gpiod_multi_set_value_cansleep

Reduce verbosity by using gpiod_multi_set_value_cansleep() instead of
gpiod_set_array_value_cansleep().

Also add max3191x_ namespace prefix to the driver's helper function
since we are changing the function signature anyway.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Link: https://lore.kernel.org/r/20250210-gpio-set-array-helper-v3-6-d6a673674da8@baylibre.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

authored by

David Lechner and committed by
Bartosz Golaszewski
eb2e9c30 e6aaeffe

+7 -11
+7 -11
drivers/gpio/gpio-max3191x.c
··· 309 309 return 0; 310 310 } 311 311 312 - static void gpiod_set_array_single_value_cansleep(unsigned int ndescs, 313 - struct gpio_desc **desc, 314 - struct gpio_array *info, 312 + static void max3191x_gpiod_multi_set_single_value(struct gpio_descs *descs, 315 313 int value) 316 314 { 317 315 unsigned long *values; 318 316 319 - values = bitmap_alloc(ndescs, GFP_KERNEL); 317 + values = bitmap_alloc(descs->ndescs, GFP_KERNEL); 320 318 if (!values) 321 319 return; 322 320 323 321 if (value) 324 - bitmap_fill(values, ndescs); 322 + bitmap_fill(values, descs->ndescs); 325 323 else 326 - bitmap_zero(values, ndescs); 324 + bitmap_zero(values, descs->ndescs); 327 325 328 - gpiod_set_array_value_cansleep(ndescs, desc, info, values); 326 + gpiod_multi_set_value_cansleep(descs, values); 329 327 bitmap_free(values); 330 328 } 331 329 ··· 394 396 max3191x->mode = device_property_read_bool(dev, "maxim,modesel-8bit") 395 397 ? STATUS_BYTE_DISABLED : STATUS_BYTE_ENABLED; 396 398 if (max3191x->modesel_pins) 397 - gpiod_set_array_single_value_cansleep( 398 - max3191x->modesel_pins->ndescs, 399 - max3191x->modesel_pins->desc, 400 - max3191x->modesel_pins->info, max3191x->mode); 399 + max3191x_gpiod_multi_set_single_value(max3191x->modesel_pins, 400 + max3191x->mode); 401 401 402 402 max3191x->ignore_uv = device_property_read_bool(dev, 403 403 "maxim,ignore-undervoltage");