aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2025-10-17 17:58:44 +0000
committersaturneric <[email protected]>2025-10-17 17:58:44 +0000
commit007f97ada358b7506c9c8a082dabcb57fe884dbc (patch)
treec327c02dec8b9d3390b2967aedf96fe4fc6083ce
parentchore(Makefile): remove unused device tree overlay file (diff)
downloadkernel-007f97ada358b7506c9c8a082dabcb57fe884dbc.tar.gz
kernel-007f97ada358b7506c9c8a082dabcb57fe884dbc.zip
refactor(gpio): change set functions to return int
* Update `bgpio_set_direct` and `bgpio_set_multiple_direct` to return an integer instead of void for better error handling. * This change allows the caller to check for success or failure of the operations.
-rw-r--r--drivers/gpio/gpio-mmio.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/gpio/gpio-mmio.c b/drivers/gpio/gpio-mmio.c
index d4311b936a85..bbefbf7064a7 100644
--- a/drivers/gpio/gpio-mmio.c
+++ b/drivers/gpio/gpio-mmio.c
@@ -235,7 +235,7 @@ static int bgpio_set(struct gpio_chip *gc, unsigned int gpio, int val)
return 0;
}
-static void bgpio_set_direct(struct gpio_chip *gc, unsigned int gpio, int val)
+static int bgpio_set_direct(struct gpio_chip *gc, unsigned int gpio, int val)
{
unsigned long mask = bgpio_line2mask(gc, gpio);
unsigned long flags;
@@ -357,7 +357,7 @@ static int bgpio_set_multiple_with_clear(struct gpio_chip *gc,
return 0;
}
-static void bgpio_set_multiple_direct(struct gpio_chip *gc,
+static int bgpio_set_multiple_direct(struct gpio_chip *gc,
unsigned long *mask,
unsigned long *bits)
{
@@ -376,6 +376,7 @@ static void bgpio_set_multiple_direct(struct gpio_chip *gc,
gc->write_reg(gc->reg_dat, gc->bgpio_data);
raw_spin_unlock_irqrestore(&gc->bgpio_lock, flags);
+ return 0;
}
static int bgpio_dir_return(struct gpio_chip *gc, unsigned int gpio, bool dir_out)