diff mbox

[1/6] brcmfmac: allow device tree node without 'interrupts' property

Message ID 1432123792-4155-2-git-send-email-arend@broadcom.com (mailing list archive)
State Accepted
Delegated to: Kalle Valo
Headers show

Commit Message

Arend van Spriel May 20, 2015, 12:09 p.m. UTC
As described in the device tree bindings for 'brcm,bcm4329-fmac'
nodes, the interrupts property is optional. So adding a check
for the presence of this property before attempting to parse
and map the interrupt. If not present or parsing fails return
and fallback to in-band sdio interrupt.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
---
 drivers/net/wireless/brcm80211/brcmfmac/of.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

Comments

Kalle Valo May 26, 2015, 11:10 a.m. UTC | #1
> As described in the device tree bindings for 'brcm,bcm4329-fmac'
> nodes, the interrupts property is optional. So adding a check
> for the presence of this property before attempting to parse
> and map the interrupt. If not present or parsing fails return
> and fallback to in-band sdio interrupt.
> 
> Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
> Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
> Signed-off-by: Arend van Spriel <arend@broadcom.com>

Thanks, 5 patches applied to wireless-drivers-next.git:

f58001fa9570 brcmfmac: allow device tree node without 'interrupts' property
464a5f3f0429 brcmfmac: Improve throughput by scheduling msbug flow worker.
fd5e8cb8178a brcmfmac: remove pci shared structure rev4 support
c2d4182edc05 brcmfmac: remove dummy cache flush/invalidate function
f3550aeb7fcd brcmfmac: add support for dma indices feature

Kalle Valo
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/wireless/brcm80211/brcmfmac/of.c b/drivers/net/wireless/brcm80211/brcmfmac/of.c
index c824570..03f35e0 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/of.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/of.c
@@ -39,10 +39,16 @@  void brcmf_of_probe(struct brcmf_sdio_dev *sdiodev)
 	if (!sdiodev->pdata)
 		return;
 
+	if (of_property_read_u32(np, "brcm,drive-strength", &val) == 0)
+		sdiodev->pdata->drive_strength = val;
+
+	/* make sure there are interrupts defined in the node */
+	if (!of_find_property(np, "interrupts", NULL))
+		return;
+
 	irq = irq_of_parse_and_map(np, 0);
 	if (!irq) {
 		brcmf_err("interrupt could not be mapped\n");
-		devm_kfree(dev, sdiodev->pdata);
 		return;
 	}
 	irqf = irqd_get_trigger_type(irq_get_irq_data(irq));
@@ -50,7 +56,4 @@  void brcmf_of_probe(struct brcmf_sdio_dev *sdiodev)
 	sdiodev->pdata->oob_irq_supported = true;
 	sdiodev->pdata->oob_irq_nr = irq;
 	sdiodev->pdata->oob_irq_flags = irqf;
-
-	if (of_property_read_u32(np, "brcm,drive-strength", &val) == 0)
-		sdiodev->pdata->drive_strength = val;
 }