mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Marek Belisko <marek.belisko@open-nandra.com>
To: swarren@nvidia.com, linus.walleij@linaro.org
Cc: grant.likely@secretlab.ca, linux-kernel@vger.kernel.org,
	Marek Belisko <marek.belisko@open-nandra.com>
Subject: [PATCH 1/2] pinmux: Remove double pin validity check.
Date: Wed, 26 Oct 2011 22:57:20 +0200	[thread overview]
Message-ID: <1319662641-28416-1-git-send-email-marek.belisko@open-nandra.com> (raw)

Function pin_is_valid just call pin_desc_get which is in pin_request
call some line below. Remove pin_is_valid() check.

Signed-off-by: Marek Belisko <marek.belisko@open-nandra.com>
---
 drivers/pinctrl/pinmux.c |   15 +++++----------
 1 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/drivers/pinctrl/pinmux.c b/drivers/pinctrl/pinmux.c
index a5467f8..b6d964f 100644
--- a/drivers/pinctrl/pinmux.c
+++ b/drivers/pinctrl/pinmux.c
@@ -112,16 +112,6 @@ static int pin_request(struct pinctrl_dev *pctldev,
 
 	dev_dbg(&pctldev->dev, "request pin %d for %s\n", pin, function);
 
-	if (!pin_is_valid(pctldev, pin)) {
-		dev_err(&pctldev->dev, "pin is invalid\n");
-		return -EINVAL;
-	}
-
-	if (!function) {
-		dev_err(&pctldev->dev, "no function name given\n");
-		return -EINVAL;
-	}
-
 	desc = pin_desc_get(pctldev, pin);
 	if (desc == NULL) {
 		dev_err(&pctldev->dev,
@@ -129,6 +119,11 @@ static int pin_request(struct pinctrl_dev *pctldev,
 		goto out;
 	}
 
+	if (!function) {
+		dev_err(&pctldev->dev, "no function name given\n");
+		return -EINVAL;
+	}
+
 	spin_lock(&desc->lock);
 	if (desc->mux_function) {
 		spin_unlock(&desc->lock);
-- 
1.7.5.4


             reply	other threads:[~2011-10-26 20:58 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-26 20:57 Marek Belisko [this message]
2011-10-26 20:57 ` [PATCH 2/2] pinmux: Unify pin type from signed to unsigned Marek Belisko
2011-10-26 21:06   ` David Rientjes
2011-10-27  6:13     ` Belisko Marek
2011-10-27 15:59       ` Stephen Warren
2011-10-28 19:53       ` Linus Walleij
2011-10-31 20:27         ` [PATH v2 " Marek Belisko
2011-11-11 14:38           ` Linus Walleij
2011-10-27 16:37 ` [PATCH 1/2] pinmux: Remove double pin validity check Stephen Warren
2011-10-27 18:39   ` Belisko Marek
2011-10-27 18:42     ` Stephen Warren
2011-10-28 19:47 ` 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=1319662641-28416-1-git-send-email-marek.belisko@open-nandra.com \
    --to=marek.belisko@open-nandra.com \
    --cc=grant.likely@secretlab.ca \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=swarren@nvidia.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®