Skip to content

Commit 2be3587

Browse files
Bartosz Golaszewskihdeller
authored andcommitted
fbdev: via: 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]> Reviewed-by: Linus Walleij <[email protected]> Signed-off-by: Helge Deller <[email protected]>
1 parent 0f70f5b commit 2be3587

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

drivers/video/fbdev/via/via-gpio.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,7 @@ struct viafb_gpio_cfg {
8181
/*
8282
* GPIO access functions
8383
*/
84-
static void via_gpio_set(struct gpio_chip *chip, unsigned int nr,
85-
int value)
84+
static int via_gpio_set(struct gpio_chip *chip, unsigned int nr, int value)
8685
{
8786
struct viafb_gpio_cfg *cfg = gpiochip_get_data(chip);
8887
u8 reg;
@@ -99,13 +98,14 @@ static void via_gpio_set(struct gpio_chip *chip, unsigned int nr,
9998
reg &= ~(0x10 << gpio->vg_mask_shift);
10099
via_write_reg(VIASR, gpio->vg_port_index, reg);
101100
spin_unlock_irqrestore(&cfg->vdev->reg_lock, flags);
101+
102+
return 0;
102103
}
103104

104105
static int via_gpio_dir_out(struct gpio_chip *chip, unsigned int nr,
105106
int value)
106107
{
107-
via_gpio_set(chip, nr, value);
108-
return 0;
108+
return via_gpio_set(chip, nr, value);
109109
}
110110

111111
/*
@@ -146,7 +146,7 @@ static struct viafb_gpio_cfg viafb_gpio_config = {
146146
.label = "VIAFB onboard GPIO",
147147
.owner = THIS_MODULE,
148148
.direction_output = via_gpio_dir_out,
149-
.set = via_gpio_set,
149+
.set_rv = via_gpio_set,
150150
.direction_input = via_gpio_dir_input,
151151
.get = via_gpio_get,
152152
.base = -1,

0 commit comments

Comments
 (0)