Skip to content

Commit d3f9603

Browse files
author
Bartosz Golaszewski
committed
gpio: ml-ioh: 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. Link: https://lore.kernel.org/r/20250506-gpiochip-set-rv-gpio-part3-v1-12-0fbdea5a9667@linaro.org Signed-off-by: Bartosz Golaszewski <[email protected]>
1 parent 5122758 commit d3f9603

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/gpio/gpio-ml-ioh.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ struct ioh_gpio {
8989

9090
static const int num_ports[] = {6, 12, 16, 16, 15, 16, 16, 12};
9191

92-
static void ioh_gpio_set(struct gpio_chip *gpio, unsigned nr, int val)
92+
static int ioh_gpio_set(struct gpio_chip *gpio, unsigned int nr, int val)
9393
{
9494
u32 reg_val;
9595
struct ioh_gpio *chip = gpiochip_get_data(gpio);
@@ -104,6 +104,8 @@ static void ioh_gpio_set(struct gpio_chip *gpio, unsigned nr, int val)
104104

105105
iowrite32(reg_val, &chip->reg->regs[chip->ch].po);
106106
spin_unlock_irqrestore(&chip->spinlock, flags);
107+
108+
return 0;
107109
}
108110

109111
static int ioh_gpio_get(struct gpio_chip *gpio, unsigned nr)
@@ -222,7 +224,7 @@ static void ioh_gpio_setup(struct ioh_gpio *chip, int num_port)
222224
gpio->direction_input = ioh_gpio_direction_input;
223225
gpio->get = ioh_gpio_get;
224226
gpio->direction_output = ioh_gpio_direction_output;
225-
gpio->set = ioh_gpio_set;
227+
gpio->set_rv = ioh_gpio_set;
226228
gpio->dbg_show = NULL;
227229
gpio->base = -1;
228230
gpio->ngpio = num_port;

0 commit comments

Comments
 (0)