diff options
author | Richard Genoud <richard.genoud@gmail.com> | 2012-08-10 18:53:49 +0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2012-08-17 13:09:58 +0400 |
commit | d599bfb324ad74e63b616809c1c13c76d1493cf9 (patch) | |
tree | 0f54b854d25fe1039252ee3c73fc0e403af6e339 /drivers/pinctrl/core.c | |
parent | ac5aa7f9e0891a115ab307b4bdde9c55b9232970 (diff) | |
download | linux-d599bfb324ad74e63b616809c1c13c76d1493cf9.tar.xz |
trivial: pinctrl core: remove extraneous code lines
In function pinctrl_get_locked, pointer p is returned on
error, and also return on no_error.
So, we just return it with no error test.
It's pretty the same in function pinctrl_lookup_state_locked:
state is returned in every case, so we drop the error test
and just return state.
Signed-off-by: Richard Genoud <richard.genoud@gmail.com>
Diffstat (limited to 'drivers/pinctrl/core.c')
-rw-r--r-- | drivers/pinctrl/core.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c index fb7f3bebdc69..dc5c126e398a 100644 --- a/drivers/pinctrl/core.c +++ b/drivers/pinctrl/core.c @@ -657,11 +657,7 @@ static struct pinctrl *pinctrl_get_locked(struct device *dev) if (p != NULL) return ERR_PTR(-EBUSY); - p = create_pinctrl(dev); - if (IS_ERR(p)) - return p; - - return p; + return create_pinctrl(dev); } /** @@ -738,11 +734,8 @@ static struct pinctrl_state *pinctrl_lookup_state_locked(struct pinctrl *p, dev_dbg(p->dev, "using pinctrl dummy state (%s)\n", name); state = create_state(p, name); - if (IS_ERR(state)) - return state; - } else { - return ERR_PTR(-ENODEV); - } + } else + state = ERR_PTR(-ENODEV); } return state; |