提交 04e5216d 编写于 作者: U Uwe Kleine-König

net/fec: no need to check for validity of ndev in suspend and resume

dev_set_drvdata is called unconditionally in the probe function and so
it cannot be NULL.
Reported-by: NLothar Waßmann <LW@KARO-electronics.de>
Signed-off-by: NUwe Kleine-König <u.kleine-koenig@pengutronix.de>
上级 b2b09ad6
......@@ -1492,16 +1492,14 @@ static int
fec_suspend(struct device *dev)
{
struct net_device *ndev = dev_get_drvdata(dev);
struct fec_enet_private *fep;
struct fec_enet_private *fep = netdev_priv(ndev);
if (ndev) {
fep = netdev_priv(ndev);
if (netif_running(ndev)) {
fec_stop(ndev);
netif_device_detach(ndev);
}
clk_disable(fep->clk);
if (netif_running(ndev)) {
fec_stop(ndev);
netif_device_detach(ndev);
}
clk_disable(fep->clk);
return 0;
}
......@@ -1509,16 +1507,14 @@ static int
fec_resume(struct device *dev)
{
struct net_device *ndev = dev_get_drvdata(dev);
struct fec_enet_private *fep;
struct fec_enet_private *fep = netdev_priv(ndev);
if (ndev) {
fep = netdev_priv(ndev);
clk_enable(fep->clk);
if (netif_running(ndev)) {
fec_restart(ndev, fep->full_duplex);
netif_device_attach(ndev);
}
clk_enable(fep->clk);
if (netif_running(ndev)) {
fec_restart(ndev, fep->full_duplex);
netif_device_attach(ndev);
}
return 0;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册