Message ID | 20250310-gpiochip-set-conversion-v1-5-03798bb833eb@linaro.org (mailing list archive) |
---|---|
State | New |
Delegated to: | Geert Uytterhoeven |
Headers | show |
Series | gpio: more gpio_chip setter conversions | expand |
On 10/03/2025 14:40, Bartosz Golaszewski wrote: > From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> > > struct gpio_chip now has callbacks for setting line values that return > an integer, allowing to indicate failures. Convert the driver to using > them. > > Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Reviewed-by: Matti Vaittinen <mazziesaccount@gmail.com> Thanks! > --- > drivers/gpio/gpio-bd9571mwv.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/gpio/gpio-bd9571mwv.c b/drivers/gpio/gpio-bd9571mwv.c > index 9a4d55f703bb..8df1361e3e84 100644 > --- a/drivers/gpio/gpio-bd9571mwv.c > +++ b/drivers/gpio/gpio-bd9571mwv.c > @@ -72,13 +72,13 @@ static int bd9571mwv_gpio_get(struct gpio_chip *chip, unsigned int offset) > return val & BIT(offset); > } > > -static void bd9571mwv_gpio_set(struct gpio_chip *chip, unsigned int offset, > +static int bd9571mwv_gpio_set(struct gpio_chip *chip, unsigned int offset, > int value) > { > struct bd9571mwv_gpio *gpio = gpiochip_get_data(chip); > > - regmap_update_bits(gpio->regmap, BD9571MWV_GPIO_OUT, > - BIT(offset), value ? BIT(offset) : 0); > + return regmap_update_bits(gpio->regmap, BD9571MWV_GPIO_OUT, > + BIT(offset), value ? BIT(offset) : 0); > } > > static const struct gpio_chip template_chip = { > @@ -88,7 +88,7 @@ static const struct gpio_chip template_chip = { > .direction_input = bd9571mwv_gpio_direction_input, > .direction_output = bd9571mwv_gpio_direction_output, > .get = bd9571mwv_gpio_get, > - .set = bd9571mwv_gpio_set, > + .set_rv = bd9571mwv_gpio_set, > .base = -1, > .ngpio = 2, > .can_sleep = true, >
diff --git a/drivers/gpio/gpio-bd9571mwv.c b/drivers/gpio/gpio-bd9571mwv.c index 9a4d55f703bb..8df1361e3e84 100644 --- a/drivers/gpio/gpio-bd9571mwv.c +++ b/drivers/gpio/gpio-bd9571mwv.c @@ -72,13 +72,13 @@ static int bd9571mwv_gpio_get(struct gpio_chip *chip, unsigned int offset) return val & BIT(offset); } -static void bd9571mwv_gpio_set(struct gpio_chip *chip, unsigned int offset, +static int bd9571mwv_gpio_set(struct gpio_chip *chip, unsigned int offset, int value) { struct bd9571mwv_gpio *gpio = gpiochip_get_data(chip); - regmap_update_bits(gpio->regmap, BD9571MWV_GPIO_OUT, - BIT(offset), value ? BIT(offset) : 0); + return regmap_update_bits(gpio->regmap, BD9571MWV_GPIO_OUT, + BIT(offset), value ? BIT(offset) : 0); } static const struct gpio_chip template_chip = { @@ -88,7 +88,7 @@ static const struct gpio_chip template_chip = { .direction_input = bd9571mwv_gpio_direction_input, .direction_output = bd9571mwv_gpio_direction_output, .get = bd9571mwv_gpio_get, - .set = bd9571mwv_gpio_set, + .set_rv = bd9571mwv_gpio_set, .base = -1, .ngpio = 2, .can_sleep = true,