From d2f6a1c6fb0e510a24ccac066eefbcfd0c932858 Mon Sep 17 00:00:00 2001 From: Marek Belisko Date: Wed, 26 Oct 2011 22:57:20 +0200 Subject: [PATCH] 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 --- drivers/pinctrl/pinmux.c | 15 +++++---------- 1 file 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); -- 2.39.5