docs/pinctrl: fix pinctrl examples
Subsystems (3)
cover docs/pinctrl: fix pinctrl examples
The document has some typos in the examples related to using pinctrl_select_state function and out-of-context variables. The patchset aims to fix that.
Siarhei Volkau (2):
docs/pinctrl: fix pinctrl_select_state examples
docs/pinctrl: fix runtime pinmuxing example
Documentation/driver-api/pin-control.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
Signature · 1 line
2.36.1
PATCH 1/2 docs/pinctrl: fix pinctrl_select_state examples
The function requires two arguments.
--- Documentation/driver-api/pin-control.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
Documentation/driver-api/pin-control.rst +3 -3
@@ -1238,7 +1238,7 @@ default state like this:: return PTR_ERR(foo->s); } - ret = pinctrl_select_state(foo->s); + ret = pinctrl_select_state(foo->p, foo->s); if (ret < 0) { /* FIXME: clean up "foo" here */ return ret;
@@ -1411,14 +1411,14 @@ on the pins defined by group B:: foo_switch() { /* Enable on position A */ - ret = pinctrl_select_state(s1); + ret = pinctrl_select_state(p, s1); if (ret < 0) ... ... /* Enable on position B */ - ret = pinctrl_select_state(s2); + ret = pinctrl_select_state(p, s2); if (ret < 0) ...
Signature · 1 line
2.36.1
PATCH 2/2 docs/pinctrl: fix runtime pinmuxing example
In reply to Siarhei VolkauThe example declares "struct pinctrl *p" but refers to "foo->p" which isn't declared in the context of the example.
--- Documentation/driver-api/pin-control.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Documentation/driver-api/pin-control.rst +2 -2
@@ -1399,11 +1399,11 @@ on the pins defined by group B:: if (IS_ERR(p)) ... - s1 = pinctrl_lookup_state(foo->p, "pos-A"); + s1 = pinctrl_lookup_state(p, "pos-A"); if (IS_ERR(s1)) ... - s2 = pinctrl_lookup_state(foo->p, "pos-B"); + s2 = pinctrl_lookup_state(p, "pos-B"); if (IS_ERR(s2)) ... }
Signature · 1 line
2.36.1
Quoted 3 lines · Siarhei Volkau
The document has some typos in the examples related to using
pinctrl_select_statefunction and out-of-context variables. The patchset aims to fix that.
Thanks so much for fixing this! My ages old mistakes...
Patches applied.
Yours,
Linus Walleij