From: Marek Belisko Date: Wed, 26 Oct 2011 20:57:20 +0000 (+0200) Subject: pinctrl: remove double pin validity check. X-Git-Tag: next-20111118~3^2~6 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=70f307fbd2700573419e4f823c4df5652e917c2a;p=karo-tx-linux.git 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 Signed-off-by: Marek Belisko Signed-off-by: Linus Walleij --- diff --git a/drivers/pinctrl/pinmux.c b/drivers/pinctrl/pinmux.c index 5c4b7828608e..3b542097f93a 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);