Skip to content

Commit 19c39c5

Browse files
author
Bartosz Golaszewski
committed
gpio: bt8xx: use new 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]>
1 parent b9a557d commit 19c39c5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/gpio/gpio-bt8xx.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,7 @@ static int bt8xxgpio_gpio_direction_output(struct gpio_chip *gpio,
119119
return 0;
120120
}
121121

122-
static void bt8xxgpio_gpio_set(struct gpio_chip *gpio,
123-
unsigned nr, int val)
122+
static int bt8xxgpio_gpio_set(struct gpio_chip *gpio, unsigned int nr, int val)
124123
{
125124
struct bt8xxgpio *bg = gpiochip_get_data(gpio);
126125
u32 data;
@@ -133,6 +132,8 @@ static void bt8xxgpio_gpio_set(struct gpio_chip *gpio,
133132
else
134133
data &= ~(1 << nr);
135134
bgwrite(data, BT848_GPIO_DATA);
135+
136+
return 0;
136137
}
137138

138139
static void bt8xxgpio_gpio_setup(struct bt8xxgpio *bg)
@@ -144,7 +145,7 @@ static void bt8xxgpio_gpio_setup(struct bt8xxgpio *bg)
144145
c->direction_input = bt8xxgpio_gpio_direction_input;
145146
c->get = bt8xxgpio_gpio_get;
146147
c->direction_output = bt8xxgpio_gpio_direction_output;
147-
c->set = bt8xxgpio_gpio_set;
148+
c->set_rv = bt8xxgpio_gpio_set;
148149
c->dbg_show = NULL;
149150
c->base = modparam_gpiobase;
150151
c->ngpio = BT8XXGPIO_NR_GPIOS;

0 commit comments

Comments
 (0)