[PATCH 1/2] pinmux: Remove double pin validity check.
From: Marek Belisko
Date: Wed Oct 26 2011 - 16:58:15 EST
Function pin_is_valid just call pin_desc_get which is in pin_request
call some line below. Remove pin_is_valid() check.
Signed-off-by: Marek Belisko <marek.belisko@xxxxxxxxxxxxxxx>
---
drivers/pinctrl/pinmux.c | 15 +++++----------
1 files changed, 5 insertions(+), 10 deletions(-)
diff --git a/drivers/pinctrl/pinmux.c b/drivers/pinctrl/pinmux.c
index a5467f8..b6d964f 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);
--
1.7.5.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/