aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpio-rcar.c
diff options
context:
space:
mode:
authorGeert Uytterhoeven <[email protected]>2025-06-25 08:05:46 +0000
committerBartosz Golaszewski <[email protected]>2025-06-26 08:52:04 +0000
commit28a9ab01f6ac87afb78cb18098bc37a74db0d8f0 (patch)
treec32f8865157098b30f58a5884d57d3f87fc764d4 /drivers/gpio/gpio-rcar.c
parentgpio: clps711x: drop unneeded platform_set_drvdata() (diff)
downloadkernel-28a9ab01f6ac87afb78cb18098bc37a74db0d8f0.tar.gz
kernel-28a9ab01f6ac87afb78cb18098bc37a74db0d8f0.zip
gpio: rcar: Remove checks for empty bankmasks
The GPIO core never passes empty bankmasks to the callbacks for handling multiple signals at once. Remove the superfluous checks, and refactor the code. Signed-off-by: Geert Uytterhoeven <[email protected]> Reviewed-by: Wolfram Sang <[email protected]> Link: https://lore.kernel.org/r/29fb200d3f92e79cdd5ce4048d2847c265f337b4.1750838486.git.geert+renesas@glider.be Signed-off-by: Bartosz Golaszewski <[email protected]>
Diffstat (limited to 'drivers/gpio/gpio-rcar.c')
-rw-r--r--drivers/gpio/gpio-rcar.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/drivers/gpio/gpio-rcar.c b/drivers/gpio/gpio-rcar.c
index 18c965ee02c8..8416e0430887 100644
--- a/drivers/gpio/gpio-rcar.c
+++ b/drivers/gpio/gpio-rcar.c
@@ -331,14 +331,11 @@ static int gpio_rcar_get(struct gpio_chip *chip, unsigned offset)
static int gpio_rcar_get_multiple(struct gpio_chip *chip, unsigned long *mask,
unsigned long *bits)
{
+ u32 bankmask = mask[0] & GENMASK(chip->ngpio - 1, 0);
struct gpio_rcar_priv *p = gpiochip_get_data(chip);
- u32 bankmask, outputs, m, val = 0;
+ u32 outputs, m, val = 0;
unsigned long flags;
- bankmask = mask[0] & GENMASK(chip->ngpio - 1, 0);
- if (!bankmask)
- return 0;
-
if (p->info.has_always_in) {
bits[0] = gpio_rcar_read(p, INDT) & bankmask;
return 0;
@@ -372,13 +369,10 @@ static void gpio_rcar_set(struct gpio_chip *chip, unsigned offset, int value)
static void gpio_rcar_set_multiple(struct gpio_chip *chip, unsigned long *mask,
unsigned long *bits)
{
+ u32 bankmask = mask[0] & GENMASK(chip->ngpio - 1, 0);
struct gpio_rcar_priv *p = gpiochip_get_data(chip);
unsigned long flags;
- u32 val, bankmask;
-
- bankmask = mask[0] & GENMASK(chip->ngpio - 1, 0);
- if (!bankmask)
- return;
+ u32 val;
raw_spin_lock_irqsave(&p->lock, flags);
val = gpio_rcar_read(p, OUTDT);