Skip to content

Commit 1938913

Browse files
author
Bartosz Golaszewski
committed
gpio: max730x: use new GPIO 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. Link: https://lore.kernel.org/r/20250506-gpiochip-set-rv-gpio-part3-v1-7-0fbdea5a9667@linaro.org Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
1 parent 75e80b6 commit 1938913

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

drivers/gpio/gpio-max730x.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,18 +143,21 @@ static int max7301_get(struct gpio_chip *chip, unsigned offset)
143143
return level;
144144
}
145145

146-
static void max7301_set(struct gpio_chip *chip, unsigned offset, int value)
146+
static int max7301_set(struct gpio_chip *chip, unsigned int offset, int value)
147147
{
148148
struct max7301 *ts = gpiochip_get_data(chip);
149+
int ret;
149150

150151
/* First 4 pins are unused in the controller */
151152
offset += 4;
152153

153154
mutex_lock(&ts->lock);
154155

155-
__max7301_set(ts, offset, value);
156+
ret = __max7301_set(ts, offset, value);
156157

157158
mutex_unlock(&ts->lock);
159+
160+
return ret;
158161
}
159162

160163
int __max730x_probe(struct max7301 *ts)
@@ -185,7 +188,7 @@ int __max730x_probe(struct max7301 *ts)
185188
ts->chip.direction_input = max7301_direction_input;
186189
ts->chip.get = max7301_get;
187190
ts->chip.direction_output = max7301_direction_output;
188-
ts->chip.set = max7301_set;
191+
ts->chip.set_rv = max7301_set;
189192

190193
ts->chip.ngpio = PIN_NUMBER;
191194
ts->chip.can_sleep = true;

0 commit comments

Comments
 (0)