提交 33e962c8 编写于 作者: S Stanislaw Gruszka 提交者: Kalle Valo

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().
Reported-by: NFelix Fietkau <nbd@nbd.name>
Fixes: 34db70b9 ("rt2x00: add copy of clk for soc devices")
Signed-off-by: NStanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
上级 575ddce0
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册