提交 caffd45e 编写于 作者: A Alexandre Belloni 提交者: David S. Miller

net/at91_ether: prepare and unprepare clock

The clock is enabled without being prepared, this leads to:

WARNING: CPU: 0 PID: 1 at drivers/clk/clk.c:889 __clk_enable+0x24/0xa8()

and a non working ethernet interface.

Use clk_prepare_enable() and clk_disable_unprepare() to handle the clock.
Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
Acked-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
Acked-by: NNicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 62058647
...@@ -340,7 +340,7 @@ static int __init at91ether_probe(struct platform_device *pdev) ...@@ -340,7 +340,7 @@ static int __init at91ether_probe(struct platform_device *pdev)
res = PTR_ERR(lp->pclk); res = PTR_ERR(lp->pclk);
goto err_free_dev; goto err_free_dev;
} }
clk_enable(lp->pclk); clk_prepare_enable(lp->pclk);
lp->hclk = ERR_PTR(-ENOENT); lp->hclk = ERR_PTR(-ENOENT);
lp->tx_clk = ERR_PTR(-ENOENT); lp->tx_clk = ERR_PTR(-ENOENT);
...@@ -406,7 +406,7 @@ static int __init at91ether_probe(struct platform_device *pdev) ...@@ -406,7 +406,7 @@ static int __init at91ether_probe(struct platform_device *pdev)
err_out_unregister_netdev: err_out_unregister_netdev:
unregister_netdev(dev); unregister_netdev(dev);
err_disable_clock: err_disable_clock:
clk_disable(lp->pclk); clk_disable_unprepare(lp->pclk);
err_free_dev: err_free_dev:
free_netdev(dev); free_netdev(dev);
return res; return res;
...@@ -424,7 +424,7 @@ static int at91ether_remove(struct platform_device *pdev) ...@@ -424,7 +424,7 @@ static int at91ether_remove(struct platform_device *pdev)
kfree(lp->mii_bus->irq); kfree(lp->mii_bus->irq);
mdiobus_free(lp->mii_bus); mdiobus_free(lp->mii_bus);
unregister_netdev(dev); unregister_netdev(dev);
clk_disable(lp->pclk); clk_disable_unprepare(lp->pclk);
free_netdev(dev); free_netdev(dev);
return 0; return 0;
...@@ -440,7 +440,7 @@ static int at91ether_suspend(struct platform_device *pdev, pm_message_t mesg) ...@@ -440,7 +440,7 @@ static int at91ether_suspend(struct platform_device *pdev, pm_message_t mesg)
netif_stop_queue(net_dev); netif_stop_queue(net_dev);
netif_device_detach(net_dev); netif_device_detach(net_dev);
clk_disable(lp->pclk); clk_disable_unprepare(lp->pclk);
} }
return 0; return 0;
} }
...@@ -451,7 +451,7 @@ static int at91ether_resume(struct platform_device *pdev) ...@@ -451,7 +451,7 @@ static int at91ether_resume(struct platform_device *pdev)
struct macb *lp = netdev_priv(net_dev); struct macb *lp = netdev_priv(net_dev);
if (netif_running(net_dev)) { if (netif_running(net_dev)) {
clk_enable(lp->pclk); clk_prepare_enable(lp->pclk);
netif_device_attach(net_dev); netif_device_attach(net_dev);
netif_start_queue(net_dev); netif_start_queue(net_dev);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册