Skip to content

Commit 74ab452

Browse files
author
Bartosz Golaszewski
committed
gpio: arizona: use new line value setter callbacks
struct gpio_chip now has callbacks for setting line values that return an integer, allowing to indicate failures. Convert the driver to using them. Reviewed-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://lore.kernel.org/r/20250303-gpiochip-set-conversion-v1-11-1d5cceeebf8b@linaro.org Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
1 parent 33dbb11 commit 74ab452

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

drivers/gpio/gpio-arizona.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,16 +121,17 @@ static int arizona_gpio_direction_out(struct gpio_chip *chip,
121121
ARIZONA_GPN_DIR | ARIZONA_GPN_LVL, value);
122122
}
123123

124-
static void arizona_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
124+
static int arizona_gpio_set(struct gpio_chip *chip, unsigned int offset,
125+
int value)
125126
{
126127
struct arizona_gpio *arizona_gpio = gpiochip_get_data(chip);
127128
struct arizona *arizona = arizona_gpio->arizona;
128129

129130
if (value)
130131
value = ARIZONA_GPN_LVL;
131132

132-
regmap_update_bits(arizona->regmap, ARIZONA_GPIO1_CTRL + offset,
133-
ARIZONA_GPN_LVL, value);
133+
return regmap_update_bits(arizona->regmap, ARIZONA_GPIO1_CTRL + offset,
134+
ARIZONA_GPN_LVL, value);
134135
}
135136

136137
static const struct gpio_chip template_chip = {
@@ -139,7 +140,7 @@ static const struct gpio_chip template_chip = {
139140
.direction_input = arizona_gpio_direction_in,
140141
.get = arizona_gpio_get,
141142
.direction_output = arizona_gpio_direction_out,
142-
.set = arizona_gpio_set,
143+
.set_rv = arizona_gpio_set,
143144
.can_sleep = true,
144145
};
145146

0 commit comments

Comments
 (0)