Skip to contentSkip to conversation

rt2x00: fix clk_get call

PATCH In review Stanislaw Gruszka 2 participants 4 messages Jan 29, 2017 – Jan 31, 2017 Ralink RT2X00 wireless LAN driver

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rt2x00: fix clk_get call

clk_get() takes two arguments and might return ERR_PTR(), so we have to nullify pointer on that case, to do not break further call to clk_get_rate().

Fixes 34db70b92fae5 ("rt2x00: add copy of clk for soc devices")
---
 drivers/net/wireless/ralink/rt2x00/rt2x00soc.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/wireless/ralink/rt2x00/rt2x00soc.c +4 -1
index 362f9d3..29250f7 100644
@@ -92,7 +92,10 @@ int rt2x00soc_probe(struct platform_device *pdev, const struct rt2x00_ops *ops)
 	rt2x00dev->hw = hw;
 	rt2x00dev->irq = platform_get_irq(pdev, 0);
 	rt2x00dev->name = pdev->dev.driver->name;
-	rt2x00dev->clk = clk_get(&pdev->dev);
+
+	rt2x00dev->clk = clk_get(&pdev->dev, NULL);
+	if (IS_ERR(rt2x00dev->clk))
+		rt2x00dev->clk = NULL;
 
 	rt2x00_set_chip_intf(rt2x00dev, RT2X00_CHIP_INTF_SOC);
 
Signature · 1 line
1.8.3.1
#1 lore raw
Quoted 7 lines · Stanislaw Gruszka

clk_get() takes two arguments and might return ERR_PTR(), so we have to nullify pointer on that case, to do not break further call to clk_get_rate().

Fixes 34db70b92fae5 ("rt2x00: add copy of clk for soc devices")

The commit id looks wrong, I think it should be:

Fixes 34db70b92fae ("rt2x00: add copy of clk for soc devices")

I can fix that during commit.

Signature · 1 line
Kalle Valo
#2 lore raw
Quoted 6 lines · Kalle Valo
Quoted 4 lines · Stanislaw Gruszka

clk_get() takes two arguments and might return ERR_PTR(), so we have to nullify pointer on that case, to do not break further call to clk_get_rate().

Quoted 7 lines
Quoted 3 lines
Fixes 34db70b92fae5 ("rt2x00: add copy of clk for soc devices")

The commit id looks wrong, I think it should be:

Fixes 34db70b92fae ("rt2x00: add copy of clk for soc devices")

Yes, this one is correct.

Quoted 1 line

I can fix that during commit.

Please do, thanks.

Stanislaw

#3 lore raw
In reply to Stanislaw Gruszka
Quoted 7 lines · Stanislaw Gruszka

clk_get() takes two arguments and might return ERR_PTR(), so we have to nullify pointer on that case, to do not break further call to clk_get_rate().

Fixes 34db70b92fae ("rt2x00: add copy of clk for soc devices")

Patch applied to wireless-drivers-next.git, thanks.

33e962c8871f rt2x00: fix clk_get call

Signature · 6 lines
https://patchwork.kernel.org/patch/9543961/

Documentation about submitting wireless patches and checking status
from patchwork:

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches