From: Marco Sirabella <marco@sirabella.org>
To: linux-kernel@vger.kernel.org
Cc: Linus Walleij <linus.walleij@linaro.org>,
Jonathan Corbet <corbet@lwn.net>,
linux-gpio@vger.kernel.org, linux-doc@vger.kernel.org,
Marco Sirabella <marco@sirabella.org>
Subject: [PATCH] Documentation: Add additional missing arg to dev_gpiod_get examples
Date: Sun, 14 Apr 2024 02:50:49 -0400 [thread overview]
Message-ID: <20240414065049.28981-1-marco@sirabella.org> (raw)
in 39b2bbe3d715 (gpio: add flags argument to gpiod_get*() functions) a
third argument was added to the function, apply that to examples found
in the tree with a simple regex: gpiod_get\([^(,]*,[^(,]*\)
Signed-off-by: Marco Sirabella <marco@sirabella.org>
---
Documentation/driver-api/pin-control.rst | 2 +-
Documentation/firmware-guide/acpi/enumeration.rst | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/Documentation/driver-api/pin-control.rst b/Documentation/driver-api/pin-control.rst
index 4639912dc9cc..bdb0a17d092b 100644
--- a/Documentation/driver-api/pin-control.rst
+++ b/Documentation/driver-api/pin-control.rst
@@ -1293,7 +1293,7 @@ So say that your driver is fetching its resources like this:
struct gpio_desc *gpio;
pinctrl = devm_pinctrl_get_select_default(&dev);
- gpio = devm_gpiod_get(&dev, "foo");
+ gpio = devm_gpiod_get(&dev, "foo", GPIOD_ASIS);
Here we first request a certain pin state and then request GPIO "foo" to be
used. If you're using the subsystems orthogonally like this, you should
diff --git a/Documentation/firmware-guide/acpi/enumeration.rst b/Documentation/firmware-guide/acpi/enumeration.rst
index 0165b09c0957..f9dcf15f7346 100644
--- a/Documentation/firmware-guide/acpi/enumeration.rst
+++ b/Documentation/firmware-guide/acpi/enumeration.rst
@@ -416,11 +416,11 @@ a code like this::
struct gpio_desc *irq_desc, *power_desc;
- irq_desc = gpiod_get(dev, "irq");
+ irq_desc = gpiod_get(dev, "irq", GPIOD_IN);
if (IS_ERR(irq_desc))
/* handle error */
- power_desc = gpiod_get(dev, "power");
+ power_desc = gpiod_get(dev, "power", GPIOD_IN);
if (IS_ERR(power_desc))
/* handle error */
--
2.43.2
reply other threads:[~2024-04-14 6:56 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240414065049.28981-1-marco@sirabella.org \
--to=marco@sirabella.org \
--cc=corbet@lwn.net \
--cc=linus.walleij@linaro.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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 read-only IMAP folder(s) and NNTP newsgroup(s).