Skip to content

Commit

Permalink
gpio: mb86s70: Revert "Return error if requesting an already assigned…
Browse files Browse the repository at this point in the history
… gpio"

Commit fd9c963 ("gpio: mb86s70: Return error if requesting an
already assigned gpio") adds code that infers from the state of the
GPIO Pin Function Register (PFR) whether a GPIO has been assigned
already. This assumes that the pin functions are set to 'peripheral'
when the driver is loaded, which is not guaranteed. Also, the GPIO
layer is perfectly capable of keeping track of which GPIOs have been
assigned already, so we shouldn't need this check in the first place.

This reverts commit fd9c963.

Cc: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Acked-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
  • Loading branch information
Ard Biesheuvel authored and Linus Walleij committed Oct 31, 2017
1 parent e1289db commit eb32889
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions drivers/gpio/gpio-mb86s7x.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,6 @@ static int mb86s70_gpio_request(struct gpio_chip *gc, unsigned gpio)
spin_lock_irqsave(&gchip->lock, flags);

val = readl(gchip->base + PFR(gpio));
if (!(val & OFFSET(gpio))) {
spin_unlock_irqrestore(&gchip->lock, flags);
return -EINVAL;
}

val &= ~OFFSET(gpio);
writel(val, gchip->base + PFR(gpio));

Expand Down

0 comments on commit eb32889

Please sign in to comment.