Commit d599bfb3 authored by Richard Genoud's avatar Richard Genoud Committed by Linus Walleij

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: default avatarRichard Genoud <richard.genoud@gmail.com>
parent ac5aa7f9
...@@ -657,11 +657,7 @@ static struct pinctrl *pinctrl_get_locked(struct device *dev) ...@@ -657,11 +657,7 @@ static struct pinctrl *pinctrl_get_locked(struct device *dev)
if (p != NULL) if (p != NULL)
return ERR_PTR(-EBUSY); return ERR_PTR(-EBUSY);
p = create_pinctrl(dev); return create_pinctrl(dev);
if (IS_ERR(p))
return p;
return p;
} }
/** /**
...@@ -738,11 +734,8 @@ static struct pinctrl_state *pinctrl_lookup_state_locked(struct pinctrl *p, ...@@ -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", dev_dbg(p->dev, "using pinctrl dummy state (%s)\n",
name); name);
state = create_state(p, name); state = create_state(p, name);
if (IS_ERR(state)) } else
return state; state = ERR_PTR(-ENODEV);
} else {
return ERR_PTR(-ENODEV);
}
} }
return state; return state;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment