* [PATCH] rt2x00: fix clk_get call
@ 2017-01-29 11:40 Stanislaw Gruszka
2017-01-29 14:53 ` Kalle Valo
2017-01-31 7:09 ` Kalle Valo
0 siblings, 2 replies; 4+ messages in thread
From: Stanislaw Gruszka @ 2017-01-29 11:40 UTC (permalink / raw)
To: linux-wireless; +Cc: Helmut Schaa, Daniel Golle, Felix Fietkau
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().
Reported-by: Felix Fietkau <nbd@nbd.name>
Fixes: 34db70b92fae5 ("rt2x00: add copy of clk for soc devices")
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
drivers/net/wireless/ralink/rt2x00/rt2x00soc.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00soc.c b/drivers/net/wireless/ralink/rt2x00/rt2x00soc.c
index 362f9d3..29250f7 100644
--- a/drivers/net/wireless/ralink/rt2x00/rt2x00soc.c
+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00soc.c
@@ -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);
--
1.8.3.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] rt2x00: fix clk_get call
2017-01-29 11:40 [PATCH] rt2x00: fix clk_get call Stanislaw Gruszka
@ 2017-01-29 14:53 ` Kalle Valo
2017-01-30 9:54 ` Stanislaw Gruszka
2017-01-31 7:09 ` Kalle Valo
1 sibling, 1 reply; 4+ messages in thread
From: Kalle Valo @ 2017-01-29 14:53 UTC (permalink / raw)
To: Stanislaw Gruszka
Cc: linux-wireless, Helmut Schaa, Daniel Golle, Felix Fietkau
Stanislaw Gruszka <sgruszka@redhat.com> writes:
> 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().
>
> Reported-by: Felix Fietkau <nbd@nbd.name>
> Fixes: 34db70b92fae5 ("rt2x00: add copy of clk for soc devices")
> Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
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.
--
Kalle Valo
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] rt2x00: fix clk_get call
2017-01-29 14:53 ` Kalle Valo
@ 2017-01-30 9:54 ` Stanislaw Gruszka
0 siblings, 0 replies; 4+ messages in thread
From: Stanislaw Gruszka @ 2017-01-30 9:54 UTC (permalink / raw)
To: Kalle Valo; +Cc: linux-wireless, Helmut Schaa, Daniel Golle, Felix Fietkau
On Sun, Jan 29, 2017 at 04:53:38PM +0200, Kalle Valo wrote:
> Stanislaw Gruszka <sgruszka@redhat.com> writes:
>
> > 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().
> >
> > Reported-by: Felix Fietkau <nbd@nbd.name>
> > Fixes: 34db70b92fae5 ("rt2x00: add copy of clk for soc devices")
> > Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
>
> 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.
> I can fix that during commit.
Please do, thanks.
Stanislaw
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: rt2x00: fix clk_get call
2017-01-29 11:40 [PATCH] rt2x00: fix clk_get call Stanislaw Gruszka
2017-01-29 14:53 ` Kalle Valo
@ 2017-01-31 7:09 ` Kalle Valo
1 sibling, 0 replies; 4+ messages in thread
From: Kalle Valo @ 2017-01-31 7:09 UTC (permalink / raw)
To: Stanislaw Gruszka
Cc: linux-wireless, Helmut Schaa, Daniel Golle, Felix Fietkau
Stanislaw Gruszka <sgruszka@redhat.com> wrote:
> 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().
>
> Reported-by: Felix Fietkau <nbd@nbd.name>
> Fixes: 34db70b92fae ("rt2x00: add copy of clk for soc devices")
> Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Patch applied to wireless-drivers-next.git, thanks.
33e962c8871f rt2x00: fix clk_get call
--
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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-01-31 7:09 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-29 11:40 [PATCH] rt2x00: fix clk_get call Stanislaw Gruszka
2017-01-29 14:53 ` Kalle Valo
2017-01-30 9:54 ` Stanislaw Gruszka
2017-01-31 7:09 ` Kalle Valo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).