diff options
author | Axel Lin <axel.lin@ingics.com> | 2012-11-13 20:20:50 +0800 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2012-11-15 12:31:23 +0100 |
commit | 6f37b1b4d407d6abcd24c4519cd892903229cd95 (patch) | |
tree | 2ff0edf60a91f17fb7c16d6c587357dda5f33d45 /drivers/pinctrl/spear/pinctrl-spear.c | |
parent | 80357203ec68a2c8ebcb61d2cebdf02d10369af1 (diff) | |
download | linux-6f37b1b4d407d6abcd24c4519cd892903229cd95.tar.gz |
pinctrl: spear: Make get_gpio_pingroup return NULL when no gpio_pingroup found
Currently get_gpio_pingroup() may return NULL or ERR_PTR(-EINVAL) when
no gpio_pingroup found. The caller in gpio_request_endisable() only
checks if the return value is NULL. Return ERR_PTR(-EINVAL) for
get_gpio_pingroup() causes problem and seems not necessary.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/spear/pinctrl-spear.c')
-rw-r--r-- | drivers/pinctrl/spear/pinctrl-spear.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/pinctrl/spear/pinctrl-spear.c b/drivers/pinctrl/spear/pinctrl-spear.c index add933286e94..bf78eb7f85c4 100644 --- a/drivers/pinctrl/spear/pinctrl-spear.c +++ b/drivers/pinctrl/spear/pinctrl-spear.c @@ -286,12 +286,12 @@ static struct spear_gpio_pingroup *get_gpio_pingroup(struct spear_pmx *pmx, unsigned pin) { struct spear_gpio_pingroup *gpio_pingroup; - int i = 0, j; + int i, j; if (!pmx->machdata->gpio_pingroups) return NULL; - for (; i < pmx->machdata->ngpio_pingroups; i++) { + for (i = 0; i < pmx->machdata->ngpio_pingroups; i++) { gpio_pingroup = &pmx->machdata->gpio_pingroups[i]; for (j = 0; j < gpio_pingroup->npins; j++) { @@ -300,7 +300,7 @@ static struct spear_gpio_pingroup *get_gpio_pingroup(struct spear_pmx *pmx, } } - return ERR_PTR(-EINVAL); + return NULL; } static int gpio_request_endisable(struct pinctrl_dev *pctldev, |