Skip to content

Commit 2318a48

Browse files
Bartosz Golaszewskigregkh
authored andcommitted
serial: max310x: 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 9d64c6a commit 2318a48

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

drivers/tty/serial/max310x.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1189,13 +1189,16 @@ static int max310x_gpio_get(struct gpio_chip *chip, unsigned int offset)
11891189
return !!((val >> 4) & (1 << (offset % 4)));
11901190
}
11911191

1192-
static void max310x_gpio_set(struct gpio_chip *chip, unsigned int offset, int value)
1192+
static int max310x_gpio_set(struct gpio_chip *chip, unsigned int offset,
1193+
int value)
11931194
{
11941195
struct max310x_port *s = gpiochip_get_data(chip);
11951196
struct uart_port *port = &s->p[offset / 4].port;
11961197

11971198
max310x_port_update(port, MAX310X_GPIODATA_REG, 1 << (offset % 4),
11981199
value ? 1 << (offset % 4) : 0);
1200+
1201+
return 0;
11991202
}
12001203

12011204
static int max310x_gpio_direction_input(struct gpio_chip *chip, unsigned int offset)
@@ -1411,7 +1414,7 @@ static int max310x_probe(struct device *dev, const struct max310x_devtype *devty
14111414
s->gpio.direction_input = max310x_gpio_direction_input;
14121415
s->gpio.get = max310x_gpio_get;
14131416
s->gpio.direction_output= max310x_gpio_direction_output;
1414-
s->gpio.set = max310x_gpio_set;
1417+
s->gpio.set_rv = max310x_gpio_set;
14151418
s->gpio.set_config = max310x_gpio_set_config;
14161419
s->gpio.base = -1;
14171420
s->gpio.ngpio = devtype->nr * 4;

0 commit comments

Comments
 (0)