mirror of
https://github.com/torvalds/linux.git
synced 2026-05-25 23:52:08 +02:00
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 <geert+renesas@glider.be> Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Link: https://lore.kernel.org/r/29fb200d3f92e79cdd5ce4048d2847c265f337b4.1750838486.git.geert+renesas@glider.be Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
This commit is contained in:
parent
23b33cf124
commit
28a9ab01f6
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user