public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] wifi: brcmfmac: of: Support interrupts-extended
@ 2024-06-22 21:54 Alex Bee
  2024-06-23 18:10 ` Arend van Spriel
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Alex Bee @ 2024-06-22 21:54 UTC (permalink / raw)
  To: Arend van Spriel, Kalle Valo, linux-wireless, brcm80211,
	brcm80211-dev-list.pdl, linux-kernel
  Cc: Alex Bee

The currently existing of_property_present check for interrupts does not
cover all ways interrupts can be defined in a device tree, e.g.
"interrupts-extended".

In order to support all current and future ways that can be done, drop that
check and call of_irq_parse_one to figure out if an interrupt is defined
and irq_create_of_mapping for the actual mapping and let it be handled by
the interrupt subsystem.

Signed-off-by: Alex Bee <knaerzche@gmail.com>
---
Link to v1:
https://lore.kernel.org/all/20240621225558.280462-1-knaerzche@gmail.com/

 drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c
index e406e11481a6..fe4f65756105 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c
@@ -70,6 +70,7 @@ void brcmf_of_probe(struct device *dev, enum brcmf_bus_type bus_type,
 {
 	struct brcmfmac_sdio_pd *sdio = &settings->bus.sdio;
 	struct device_node *root, *np = dev->of_node;
+	struct of_phandle_args oirq;
 	const char *prop;
 	int irq;
 	int err;
@@ -129,10 +130,10 @@ void brcmf_of_probe(struct device *dev, enum brcmf_bus_type bus_type,
 		sdio->drive_strength = val;
 
 	/* make sure there are interrupts defined in the node */
-	if (!of_property_present(np, "interrupts"))
+	if (of_irq_parse_one(np, 0, &oirq))
 		return;
 
-	irq = irq_of_parse_and_map(np, 0);
+	irq = irq_create_of_mapping(&oirq);
 	if (!irq) {
 		brcmf_err("interrupt could not be mapped\n");
 		return;
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-01-06 16:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-22 21:54 [PATCH v2] wifi: brcmfmac: of: Support interrupts-extended Alex Bee
2024-06-23 18:10 ` Arend van Spriel
2024-06-26 17:51 ` Kalle Valo
2025-01-05 15:49 ` Luca Weiss
2025-01-05 20:36   ` Alex Bee
2025-01-06 16:51     ` Luca Weiss

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox