提交 d2f6a1c6 编写于 作者: M Marek Belisko 提交者: Linus Walleij

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: NStephen Warren <swarren@nvidia.com>
Signed-off-by: NMarek Belisko <marek.belisko@open-nandra.com>
Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
上级 7afde8ba
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册