Skip to content

Commit

Permalink
pinctrl: remove double pin validity check.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Marek Belisko authored and Linus Walleij committed Jan 3, 2012
1 parent 7afde8b commit d2f6a1c
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions drivers/pinctrl/pinmux.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,23 +108,18 @@ 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,
"pin is not registered so it cannot be requested\n");
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);
Expand Down

0 comments on commit d2f6a1c

Please sign in to comment.