Skip to content

Commit a548240

Browse files
Bartosz Golaszewskigregkh
authored andcommitted
serial: sc16is7xx: 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. Signed-off-by: Bartosz Golaszewski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 2318a48 commit a548240

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

drivers/tty/serial/sc16is7xx.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1333,13 +1333,16 @@ static int sc16is7xx_gpio_get(struct gpio_chip *chip, unsigned offset)
13331333
return !!(val & BIT(offset));
13341334
}
13351335

1336-
static void sc16is7xx_gpio_set(struct gpio_chip *chip, unsigned offset, int val)
1336+
static int sc16is7xx_gpio_set(struct gpio_chip *chip, unsigned int offset,
1337+
int val)
13371338
{
13381339
struct sc16is7xx_port *s = gpiochip_get_data(chip);
13391340
struct uart_port *port = &s->p[0].port;
13401341

13411342
sc16is7xx_port_update(port, SC16IS7XX_IOSTATE_REG, BIT(offset),
13421343
val ? BIT(offset) : 0);
1344+
1345+
return 0;
13431346
}
13441347

13451348
static int sc16is7xx_gpio_direction_input(struct gpio_chip *chip,
@@ -1422,7 +1425,7 @@ static int sc16is7xx_setup_gpio_chip(struct sc16is7xx_port *s)
14221425
s->gpio.direction_input = sc16is7xx_gpio_direction_input;
14231426
s->gpio.get = sc16is7xx_gpio_get;
14241427
s->gpio.direction_output = sc16is7xx_gpio_direction_output;
1425-
s->gpio.set = sc16is7xx_gpio_set;
1428+
s->gpio.set_rv = sc16is7xx_gpio_set;
14261429
s->gpio.base = -1;
14271430
s->gpio.ngpio = s->devtype->nr_gpio;
14281431
s->gpio.can_sleep = 1;

0 commit comments

Comments
 (0)