diff options
| author | Bartosz Golaszewski <[email protected]> | 2025-05-06 09:01:50 +0000 |
|---|---|---|
| committer | Bartosz Golaszewski <[email protected]> | 2025-05-13 13:15:34 +0000 |
| commit | 1938913798082cd284ab59afcdf68c2bb5ba1686 (patch) | |
| tree | 70e386ffe69faa9f6bdc1a8493b22bce91b475c9 /drivers/gpio/gpio-max730x.c | |
| parent | gpio: max3191x: remove unused callbacks (diff) | |
| download | kernel-1938913798082cd284ab59afcdf68c2bb5ba1686.tar.gz kernel-1938913798082cd284ab59afcdf68c2bb5ba1686.zip | |
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/[email protected]
Signed-off-by: Bartosz Golaszewski <[email protected]>
Diffstat (limited to 'drivers/gpio/gpio-max730x.c')
| -rw-r--r-- | drivers/gpio/gpio-max730x.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/gpio/gpio-max730x.c b/drivers/gpio/gpio-max730x.c index e688c13c8cc3..75d414d8c992 100644 --- a/drivers/gpio/gpio-max730x.c +++ b/drivers/gpio/gpio-max730x.c @@ -143,18 +143,21 @@ static int max7301_get(struct gpio_chip *chip, unsigned offset) return level; } -static void max7301_set(struct gpio_chip *chip, unsigned offset, int value) +static int max7301_set(struct gpio_chip *chip, unsigned int offset, int value) { struct max7301 *ts = gpiochip_get_data(chip); + int ret; /* First 4 pins are unused in the controller */ offset += 4; mutex_lock(&ts->lock); - __max7301_set(ts, offset, value); + ret = __max7301_set(ts, offset, value); mutex_unlock(&ts->lock); + + return ret; } int __max730x_probe(struct max7301 *ts) @@ -185,7 +188,7 @@ int __max730x_probe(struct max7301 *ts) ts->chip.direction_input = max7301_direction_input; ts->chip.get = max7301_get; ts->chip.direction_output = max7301_direction_output; - ts->chip.set = max7301_set; + ts->chip.set_rv = max7301_set; ts->chip.ngpio = PIN_NUMBER; ts->chip.can_sleep = true; |
