mirror of
https://github.com/torvalds/linux.git
synced 2026-05-24 07:03:03 +02:00
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>
This commit is contained in:
parent
e6aaeffeaf
commit
eb2e9c308d
|
|
@ -309,23 +309,21 @@ static int max3191x_set_config(struct gpio_chip *gpio, unsigned int offset,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void gpiod_set_array_single_value_cansleep(unsigned int ndescs,
|
||||
struct gpio_desc **desc,
|
||||
struct gpio_array *info,
|
||||
static void max3191x_gpiod_multi_set_single_value(struct gpio_descs *descs,
|
||||
int value)
|
||||
{
|
||||
unsigned long *values;
|
||||
|
||||
values = bitmap_alloc(ndescs, GFP_KERNEL);
|
||||
values = bitmap_alloc(descs->ndescs, GFP_KERNEL);
|
||||
if (!values)
|
||||
return;
|
||||
|
||||
if (value)
|
||||
bitmap_fill(values, ndescs);
|
||||
bitmap_fill(values, descs->ndescs);
|
||||
else
|
||||
bitmap_zero(values, ndescs);
|
||||
bitmap_zero(values, descs->ndescs);
|
||||
|
||||
gpiod_set_array_value_cansleep(ndescs, desc, info, values);
|
||||
gpiod_multi_set_value_cansleep(descs, values);
|
||||
bitmap_free(values);
|
||||
}
|
||||
|
||||
|
|
@ -396,10 +394,8 @@ static int max3191x_probe(struct spi_device *spi)
|
|||
max3191x->mode = device_property_read_bool(dev, "maxim,modesel-8bit")
|
||||
? STATUS_BYTE_DISABLED : STATUS_BYTE_ENABLED;
|
||||
if (max3191x->modesel_pins)
|
||||
gpiod_set_array_single_value_cansleep(
|
||||
max3191x->modesel_pins->ndescs,
|
||||
max3191x->modesel_pins->desc,
|
||||
max3191x->modesel_pins->info, max3191x->mode);
|
||||
max3191x_gpiod_multi_set_single_value(max3191x->modesel_pins,
|
||||
max3191x->mode);
|
||||
|
||||
max3191x->ignore_uv = device_property_read_bool(dev,
|
||||
"maxim,ignore-undervoltage");
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user