Skip to content

Commit 68bdc4d

Browse files
Bartosz Golaszewskitsbogend
authored andcommitted
MIPS: alchemy: gpio: 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. Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
1 parent 64f3322 commit 68bdc4d

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

arch/mips/alchemy/common/gpiolib.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,11 @@ static int alchemy_gpic_get(struct gpio_chip *chip, unsigned int off)
119119
return !!au1300_gpio_get_value(off + AU1300_GPIO_BASE);
120120
}
121121

122-
static void alchemy_gpic_set(struct gpio_chip *chip, unsigned int off, int v)
122+
static int alchemy_gpic_set(struct gpio_chip *chip, unsigned int off, int v)
123123
{
124124
au1300_gpio_set_value(off + AU1300_GPIO_BASE, v);
125+
126+
return 0;
125127
}
126128

127129
static int alchemy_gpic_dir_input(struct gpio_chip *chip, unsigned int off)
@@ -145,7 +147,7 @@ static struct gpio_chip au1300_gpiochip = {
145147
.direction_input = alchemy_gpic_dir_input,
146148
.direction_output = alchemy_gpic_dir_output,
147149
.get = alchemy_gpic_get,
148-
.set = alchemy_gpic_set,
150+
.set_rv = alchemy_gpic_set,
149151
.to_irq = alchemy_gpic_gpio_to_irq,
150152
.base = AU1300_GPIO_BASE,
151153
.ngpio = AU1300_GPIO_NUM,

0 commit comments

Comments
 (0)