From: Sasha Levin <sashal@kernel.org>
To: stable@vger.kernel.org
Cc: Akhil R <akhilrajeev@nvidia.com>,
Andy Shevchenko <andy.shevchenko@gmail.com>,
"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
Wolfram Sang <wsa@kernel.org>, Sasha Levin <sashal@kernel.org>
Subject: [PATCH 5.10.y 1/7] device property: Add fwnode_irq_get_byname
Date: Wed, 22 Jul 2026 06:30:22 -0400 [thread overview]
Message-ID: <20260722103029.890864-1-sashal@kernel.org> (raw)
In-Reply-To: <2026071657-book-manhandle-a0e6@gregkh>
From: Akhil R <akhilrajeev@nvidia.com>
[ Upstream commit ca0acb511c21738b32386ce0f85c284b351d919e ]
Add fwnode_irq_get_byname() to get an interrupt by name from either
ACPI table or Device Tree, whichever is used for enumeration.
In the ACPI case, this allow us to use 'interrupt-names' in
_DSD which can be mapped to Interrupt() resource by index.
The implementation is similar to 'interrupt-names' in the
Device Tree.
Signed-off-by: Akhil R <akhilrajeev@nvidia.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Stable-dep-of: 158efa411c57 ("i2c: core: fix adapter probe deferral loop")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/base/property.c | 29 +++++++++++++++++++++++++++++
include/linux/property.h | 1 +
2 files changed, 30 insertions(+)
diff --git a/drivers/base/property.c b/drivers/base/property.c
index c26ce7fd6832fc..2c0778089ae76f 100644
--- a/drivers/base/property.c
+++ b/drivers/base/property.c
@@ -1042,6 +1042,35 @@ int fwnode_irq_get(const struct fwnode_handle *fwnode, unsigned int index)
}
EXPORT_SYMBOL(fwnode_irq_get);
+/**
+ * fwnode_irq_get_byname - Get IRQ from a fwnode using its name
+ * @fwnode: Pointer to the firmware node
+ * @name: IRQ name
+ *
+ * Description:
+ * Find a match to the string @name in the 'interrupt-names' string array
+ * in _DSD for ACPI, or of_node for Device Tree. Then get the Linux IRQ
+ * number of the IRQ resource corresponding to the index of the matched
+ * string.
+ *
+ * Return:
+ * Linux IRQ number on success, or negative errno otherwise.
+ */
+int fwnode_irq_get_byname(const struct fwnode_handle *fwnode, const char *name)
+{
+ int index;
+
+ if (!name)
+ return -EINVAL;
+
+ index = fwnode_property_match_string(fwnode, "interrupt-names", name);
+ if (index < 0)
+ return index;
+
+ return fwnode_irq_get(fwnode, index);
+}
+EXPORT_SYMBOL(fwnode_irq_get_byname);
+
/**
* fwnode_graph_get_next_endpoint - Get next endpoint firmware node
* @fwnode: Pointer to the parent firmware node
diff --git a/include/linux/property.h b/include/linux/property.h
index 0604bb73e62827..98227dbac95383 100644
--- a/include/linux/property.h
+++ b/include/linux/property.h
@@ -120,6 +120,7 @@ struct fwnode_handle *fwnode_handle_get(struct fwnode_handle *fwnode);
void fwnode_handle_put(struct fwnode_handle *fwnode);
int fwnode_irq_get(const struct fwnode_handle *fwnode, unsigned int index);
+int fwnode_irq_get_byname(const struct fwnode_handle *fwnode, const char *name);
unsigned int device_get_child_node_count(struct device *dev);
--
2.53.0
next prev parent reply other threads:[~2026-07-22 10:30 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-16 12:40 FAILED: patch "[PATCH] i2c: core: fix adapter probe deferral loop" failed to apply to 5.10-stable tree gregkh
2026-07-22 10:30 ` Sasha Levin [this message]
2026-07-22 10:30 ` [PATCH 5.10.y 2/7] i2c: smbus: Use device_*() functions instead of of_*() Sasha Levin
2026-07-22 10:30 ` [PATCH 5.10.y 3/7] i2c: core: Setup i2c_adapter runtime-pm before calling device_add() Sasha Levin
2026-07-22 10:30 ` [PATCH 5.10.y 4/7] i2c: core: fix reference leak in i2c_register_adapter() Sasha Levin
2026-07-22 10:30 ` [PATCH 5.10.y 5/7] i2c: core: fix irq domain leak on adapter registration failure Sasha Levin
2026-07-22 10:30 ` [PATCH 5.10.y 6/7] i2c: core: fix NULL-deref " Sasha Levin
2026-07-22 10:30 ` [PATCH 5.10.y 7/7] i2c: core: fix adapter probe deferral loop Sasha Levin
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=20260722103029.890864-1-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=akhilrajeev@nvidia.com \
--cc=andy.shevchenko@gmail.com \
--cc=rafael.j.wysocki@intel.com \
--cc=stable@vger.kernel.org \
--cc=wsa@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