Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fd9c963c authored by Axel Lin's avatar Axel Lin Committed by Linus Walleij
Browse files

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

parent c517d838
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -58,6 +58,11 @@ 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));