From: Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>
To: "Rafael J. Wysocki" <rafael@kernel.org>,
Len Brown <lenb@kernel.org>, Pavel Machek <pavel@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Danilo Krummrich <dakr@kernel.org>,
Bjorn Helgaas <bhelgaas@google.com>,
Bartosz Golaszewski <brgl@bgdev.pl>,
Linus Walleij <linusw@kernel.org>,
Bartosz Golaszewski <brgl@kernel.org>,
Linus Walleij <linusw@kernel.org>
Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-pci@vger.kernel.org, linux-gpio@vger.kernel.org,
quic_vbadigan@quicinc.com, quic_mrana@quicinc.com,
sherry.sun@nxp.com, driver-core@lists.linux.dev,
Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>
Subject: [PATCH v7 2/3] gpio: Add fwnode_gpiod_get() helper
Date: Wed, 18 Feb 2026 13:42:24 +0530 [thread overview]
Message-ID: <20260218-wakeirq_support-v7-2-0d4689830207@oss.qualcomm.com> (raw)
In-Reply-To: <20260218-wakeirq_support-v7-0-0d4689830207@oss.qualcomm.com>
Add fwnode_gpiod_get() as a convenience wrapper around
fwnode_gpiod_get_index() for the common case where only the
first GPIO is required.
This mirrors existing gpiod_get() and devm_gpiod_get() helpers
and avoids open-coding index 0 at call sites.
Signed-off-by: Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>
---
include/linux/gpio/consumer.h | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/include/linux/gpio/consumer.h b/include/linux/gpio/consumer.h
index 0d8408582918680bfea6a04ccedfc0c75211907a..fee926c0262ce9dc4b9a3c151e74f2cf37470a49 100644
--- a/include/linux/gpio/consumer.h
+++ b/include/linux/gpio/consumer.h
@@ -596,6 +596,15 @@ static inline int gpiod_disable_hw_timestamp_ns(struct gpio_desc *desc,
}
#endif /* CONFIG_GPIOLIB && CONFIG_HTE */
+static inline
+struct gpio_desc *fwnode_gpiod_get(struct fwnode_handle *fwnode,
+ const char *con_id,
+ enum gpiod_flags flags,
+ const char *label)
+{
+ return fwnode_gpiod_get_index(fwnode, con_id, 0, flags, label);
+}
+
static inline
struct gpio_desc *devm_fwnode_gpiod_get(struct device *dev,
struct fwnode_handle *fwnode,
--
2.34.1
next prev parent reply other threads:[~2026-02-18 8:12 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-18 8:12 [PATCH v7 0/3] PCI: Add support for PCIe WAKE# interrupt Krishna Chaitanya Chundru
2026-02-18 8:12 ` [PATCH v7 1/3] PM: sleep: wakeirq: Add support for dedicated shared wake IRQ setup Krishna Chaitanya Chundru
2026-02-18 8:12 ` Krishna Chaitanya Chundru [this message]
2026-02-19 17:45 ` [PATCH v7 2/3] gpio: Add fwnode_gpiod_get() helper Linus Walleij
2026-02-23 12:53 ` Manivannan Sadhasivam
2026-02-18 8:12 ` [PATCH v7 3/3] PCI: Add support for PCIe WAKE# interrupt Krishna Chaitanya Chundru
2026-02-18 13:49 ` kernel test robot
2026-02-18 16:58 ` kernel test robot
2026-02-23 14:07 ` Manivannan Sadhasivam
2026-02-25 12:32 ` Krishna Chaitanya Chundru
2026-02-18 10:01 ` [PATCH v7 0/3] " Bartosz Golaszewski
2026-02-24 8:13 ` Chen-Yu Tsai
2026-03-13 7:03 ` Krishna Chaitanya Chundru
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=20260218-wakeirq_support-v7-2-0d4689830207@oss.qualcomm.com \
--to=krishna.chundru@oss.qualcomm.com \
--cc=bhelgaas@google.com \
--cc=brgl@bgdev.pl \
--cc=brgl@kernel.org \
--cc=dakr@kernel.org \
--cc=driver-core@lists.linux.dev \
--cc=gregkh@linuxfoundation.org \
--cc=lenb@kernel.org \
--cc=linusw@kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=pavel@kernel.org \
--cc=quic_mrana@quicinc.com \
--cc=quic_vbadigan@quicinc.com \
--cc=rafael@kernel.org \
--cc=sherry.sun@nxp.com \
/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
all inboxes | Powered by JetHome®