* [PATCH 0/2] docs/pinctrl: fix pinctrl examples
@ 2022-11-01 20:51 Siarhei Volkau
2022-11-01 20:51 ` [PATCH 1/2] docs/pinctrl: fix pinctrl_select_state examples Siarhei Volkau
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Siarhei Volkau @ 2022-11-01 20:51 UTC (permalink / raw)
Cc: Siarhei Volkau, Linus Walleij, Jonathan Corbet, linux-gpio,
linux-doc, linux-kernel
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(-)
--
2.36.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/2] docs/pinctrl: fix pinctrl_select_state examples
2022-11-01 20:51 [PATCH 0/2] docs/pinctrl: fix pinctrl examples Siarhei Volkau
@ 2022-11-01 20:51 ` Siarhei Volkau
2022-11-01 20:51 ` [PATCH 2/2] docs/pinctrl: fix runtime pinmuxing example Siarhei Volkau
2022-11-08 12:41 ` [PATCH 0/2] docs/pinctrl: fix pinctrl examples Linus Walleij
2 siblings, 0 replies; 4+ messages in thread
From: Siarhei Volkau @ 2022-11-01 20:51 UTC (permalink / raw)
Cc: Siarhei Volkau, Linus Walleij, Jonathan Corbet, linux-gpio,
linux-doc, linux-kernel
The function requires two arguments.
Signed-off-by: Siarhei Volkau <lis8215@gmail.com>
---
Documentation/driver-api/pin-control.rst | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/Documentation/driver-api/pin-control.rst b/Documentation/driver-api/pin-control.rst
index 71eefe5a0..19a41c68d 100644
--- a/Documentation/driver-api/pin-control.rst
+++ b/Documentation/driver-api/pin-control.rst
@@ -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)
...
--
2.36.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] docs/pinctrl: fix runtime pinmuxing example
2022-11-01 20:51 [PATCH 0/2] docs/pinctrl: fix pinctrl examples Siarhei Volkau
2022-11-01 20:51 ` [PATCH 1/2] docs/pinctrl: fix pinctrl_select_state examples Siarhei Volkau
@ 2022-11-01 20:51 ` Siarhei Volkau
2022-11-08 12:41 ` [PATCH 0/2] docs/pinctrl: fix pinctrl examples Linus Walleij
2 siblings, 0 replies; 4+ messages in thread
From: Siarhei Volkau @ 2022-11-01 20:51 UTC (permalink / raw)
Cc: Siarhei Volkau, Linus Walleij, Jonathan Corbet, linux-gpio,
linux-doc, linux-kernel
The example declares "struct pinctrl *p" but refers to
"foo->p" which isn't declared in the context of the example.
Signed-off-by: Siarhei Volkau <lis8215@gmail.com>
---
Documentation/driver-api/pin-control.rst | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Documentation/driver-api/pin-control.rst b/Documentation/driver-api/pin-control.rst
index 19a41c68d..0022e930e 100644
--- a/Documentation/driver-api/pin-control.rst
+++ b/Documentation/driver-api/pin-control.rst
@@ -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))
...
}
--
2.36.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 0/2] docs/pinctrl: fix pinctrl examples
2022-11-01 20:51 [PATCH 0/2] docs/pinctrl: fix pinctrl examples Siarhei Volkau
2022-11-01 20:51 ` [PATCH 1/2] docs/pinctrl: fix pinctrl_select_state examples Siarhei Volkau
2022-11-01 20:51 ` [PATCH 2/2] docs/pinctrl: fix runtime pinmuxing example Siarhei Volkau
@ 2022-11-08 12:41 ` Linus Walleij
2 siblings, 0 replies; 4+ messages in thread
From: Linus Walleij @ 2022-11-08 12:41 UTC (permalink / raw)
To: Siarhei Volkau; +Cc: Jonathan Corbet, linux-gpio, linux-doc, linux-kernel
On Tue, Nov 1, 2022 at 9:52 PM Siarhei Volkau <lis8215@gmail.com> wrote:
> 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.
Thanks so much for fixing this! My ages old mistakes...
Patches applied.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-11-08 12:41 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-01 20:51 [PATCH 0/2] docs/pinctrl: fix pinctrl examples Siarhei Volkau
2022-11-01 20:51 ` [PATCH 1/2] docs/pinctrl: fix pinctrl_select_state examples Siarhei Volkau
2022-11-01 20:51 ` [PATCH 2/2] docs/pinctrl: fix runtime pinmuxing example Siarhei Volkau
2022-11-08 12:41 ` [PATCH 0/2] docs/pinctrl: fix pinctrl examples Linus Walleij
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).