Commit eb328899 authored by Ard Biesheuvel's avatar Ard Biesheuvel Committed by Linus Walleij

gpio: mb86s70: Revert "Return error if requesting an already assigned gpio"

Commit fd9c963c ("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 fd9c963c.

Cc: Axel Lin <>
Signed-off-by: default avatarArd Biesheuvel <>
Acked-by: default avatarAxel Lin <>
Signed-off-by: default avatarLinus Walleij <>
parent e1289dba
......@@ -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));
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment