summaryrefslogtreecommitdiff
path: root/drivers/pinctrl
diff options
context:
space:
mode:
authorMarek Belisko <marek.belisko@open-nandra.com>2011-10-27 00:57:20 +0400
committerLinus Walleij <linus.walleij@linaro.org>2012-01-03 12:09:59 +0400
commitd2f6a1c6fb0e510a24ccac066eefbcfd0c932858 (patch)
treea5180b9b911b32508c6423852a5419110bf5b821 /drivers/pinctrl
parent7afde8baa83b9ac409a6db86f27a41878aa6b33f (diff)
downloadlinux-d2f6a1c6fb0e510a24ccac066eefbcfd0c932858.tar.xz
pinctrl: remove double pin validity check.
Function pin_is_valid just call pin_desc_get which is in pin_request call some line below. Remove pin_is_valid() check. Acked-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Marek Belisko <marek.belisko@open-nandra.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl')
-rw-r--r--drivers/pinctrl/pinmux.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/drivers/pinctrl/pinmux.c b/drivers/pinctrl/pinmux.c
index 72b760bc880a..17c3931d5ef0 100644
--- a/drivers/pinctrl/pinmux.c
+++ b/drivers/pinctrl/pinmux.c
@@ -108,16 +108,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,
@@ -125,6 +115,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);