Skip to content

Commit ab100f0

Browse files
MingcongBaiFearyncess
authored andcommitted
AOSCOS: gpio: nct6102: 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. Fixes: "AOSCOS: GPIO: Add NCT6102 GPIO driver support" Signed-off-by: Mingcong Bai <jeffbai@aosc.io>
1 parent 0103d80 commit ab100f0

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

drivers/gpio/gpio-nct6102.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ static int nct6102_gpio_get_value(struct gpio_chip *chip, unsigned offset)
104104
return tmp;
105105
}
106106

107-
static void nct6102_gpio_set_value(struct gpio_chip *chip, unsigned offset, int value)
107+
static int nct6102_gpio_set_value(struct gpio_chip *chip, unsigned offset, int value)
108108
{
109109
u8 tmp;
110110

@@ -116,6 +116,8 @@ static void nct6102_gpio_set_value(struct gpio_chip *chip, unsigned offset, int
116116
tmp &= ~(1 << REG_VALUE(offset));
117117
write_dev(tmp, SIO_DEV_GPIO, SIO_GPIO_DATA_BASE + REG_ADDR_OFFSET(offset));
118118
spin_unlock(&gpio_lock);
119+
120+
return 0;
119121
}
120122

121123
static int nct6102_gpio_direction_input(struct gpio_chip *chip, unsigned offset)

0 commit comments

Comments
 (0)