All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
To: linux-gpio@vger.kernel.org
Cc: linus.walleij@linaro.org, daniel.thompson@linaro.org,
	leif.lindholm@linaro.org, jaswinder.singh@linaro.org,
	masami.hiramatsu@linaro.org,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>,
	Axel Lin <axel.lin@ingics.com>
Subject: [PATCH 2/2] gpio: mb86s70: Revert "Return error if requesting an already assigned gpio"
Date: Fri, 27 Oct 2017 21:21:48 +0100	[thread overview]
Message-ID: <20171027202148.4188-3-ard.biesheuvel@linaro.org> (raw)
In-Reply-To: <20171027202148.4188-1-ard.biesheuvel@linaro.org>

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

Cc: Axel Lin <axel.lin@ingics.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
 drivers/gpio/gpio-mb86s7x.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/gpio/gpio-mb86s7x.c b/drivers/gpio/gpio-mb86s7x.c
index 6e1598471733..5cd77dcdbb16 100644
--- a/drivers/gpio/gpio-mb86s7x.c
+++ b/drivers/gpio/gpio-mb86s7x.c
@@ -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));
 
-- 
2.11.0


  parent reply	other threads:[~2017-10-27 20:22 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-27 20:21 [PATCH 0/2] GPIO support for Socionext Synquacer Ard Biesheuvel
2017-10-27 20:21 ` [PATCH 1/2] gpio: mb86s7x: share with other SoCs as module Ard Biesheuvel
2017-10-30 17:15   ` Ard Biesheuvel
2017-10-31 12:12   ` Linus Walleij
2017-10-27 20:21 ` Ard Biesheuvel [this message]
2017-10-28  1:53   ` [PATCH 2/2] gpio: mb86s70: Revert "Return error if requesting an already assigned gpio" Axel Lin
2017-10-31 12:14   ` Linus Walleij
2017-10-31 12:20 ` [PATCH 0/2] GPIO support for Socionext Synquacer Linus Walleij
2017-10-31 12:27   ` Ard Biesheuvel
2017-10-31 12:59     ` Ard Biesheuvel
2017-10-31 13:10       ` Linus Walleij
2017-10-31 13:13     ` Linus Walleij
2017-10-31 13:19       ` Ard Biesheuvel
2017-10-31 13:19     ` Linus Walleij

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171027202148.4188-3-ard.biesheuvel@linaro.org \
    --to=ard.biesheuvel@linaro.org \
    --cc=axel.lin@ingics.com \
    --cc=daniel.thompson@linaro.org \
    --cc=jaswinder.singh@linaro.org \
    --cc=leif.lindholm@linaro.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=masami.hiramatsu@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.