|
@@ -2625,8 +2625,7 @@ static int bcmgenet_open(struct net_device *dev)
|
|
netif_dbg(priv, ifup, dev, "bcmgenet_open\n");
|
|
netif_dbg(priv, ifup, dev, "bcmgenet_open\n");
|
|
|
|
|
|
/* Turn on the clock */
|
|
/* Turn on the clock */
|
|
- if (!IS_ERR(priv->clk))
|
|
|
|
- clk_prepare_enable(priv->clk);
|
|
|
|
|
|
+ clk_prepare_enable(priv->clk);
|
|
|
|
|
|
/* If this is an internal GPHY, power it back on now, before UniMAC is
|
|
/* If this is an internal GPHY, power it back on now, before UniMAC is
|
|
* brought out of reset as absolutely no UniMAC activity is allowed
|
|
* brought out of reset as absolutely no UniMAC activity is allowed
|
|
@@ -2703,8 +2702,7 @@ err_irq0:
|
|
err_fini_dma:
|
|
err_fini_dma:
|
|
bcmgenet_fini_dma(priv);
|
|
bcmgenet_fini_dma(priv);
|
|
err_clk_disable:
|
|
err_clk_disable:
|
|
- if (!IS_ERR(priv->clk))
|
|
|
|
- clk_disable_unprepare(priv->clk);
|
|
|
|
|
|
+ clk_disable_unprepare(priv->clk);
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -2761,8 +2759,7 @@ static int bcmgenet_close(struct net_device *dev)
|
|
if (priv->internal_phy)
|
|
if (priv->internal_phy)
|
|
ret = bcmgenet_power_down(priv, GENET_POWER_PASSIVE);
|
|
ret = bcmgenet_power_down(priv, GENET_POWER_PASSIVE);
|
|
|
|
|
|
- if (!IS_ERR(priv->clk))
|
|
|
|
- clk_disable_unprepare(priv->clk);
|
|
|
|
|
|
+ clk_disable_unprepare(priv->clk);
|
|
|
|
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|
|
@@ -3215,11 +3212,12 @@ static int bcmgenet_probe(struct platform_device *pdev)
|
|
priv->version = pd->genet_version;
|
|
priv->version = pd->genet_version;
|
|
|
|
|
|
priv->clk = devm_clk_get(&priv->pdev->dev, "enet");
|
|
priv->clk = devm_clk_get(&priv->pdev->dev, "enet");
|
|
- if (IS_ERR(priv->clk))
|
|
|
|
|
|
+ if (IS_ERR(priv->clk)) {
|
|
dev_warn(&priv->pdev->dev, "failed to get enet clock\n");
|
|
dev_warn(&priv->pdev->dev, "failed to get enet clock\n");
|
|
|
|
+ priv->clk = NULL;
|
|
|
|
+ }
|
|
|
|
|
|
- if (!IS_ERR(priv->clk))
|
|
|
|
- clk_prepare_enable(priv->clk);
|
|
|
|
|
|
+ clk_prepare_enable(priv->clk);
|
|
|
|
|
|
bcmgenet_set_hw_params(priv);
|
|
bcmgenet_set_hw_params(priv);
|
|
|
|
|
|
@@ -3230,8 +3228,10 @@ static int bcmgenet_probe(struct platform_device *pdev)
|
|
INIT_WORK(&priv->bcmgenet_irq_work, bcmgenet_irq_task);
|
|
INIT_WORK(&priv->bcmgenet_irq_work, bcmgenet_irq_task);
|
|
|
|
|
|
priv->clk_wol = devm_clk_get(&priv->pdev->dev, "enet-wol");
|
|
priv->clk_wol = devm_clk_get(&priv->pdev->dev, "enet-wol");
|
|
- if (IS_ERR(priv->clk_wol))
|
|
|
|
|
|
+ if (IS_ERR(priv->clk_wol)) {
|
|
dev_warn(&priv->pdev->dev, "failed to get enet-wol clock\n");
|
|
dev_warn(&priv->pdev->dev, "failed to get enet-wol clock\n");
|
|
|
|
+ priv->clk_wol = NULL;
|
|
|
|
+ }
|
|
|
|
|
|
priv->clk_eee = devm_clk_get(&priv->pdev->dev, "enet-eee");
|
|
priv->clk_eee = devm_clk_get(&priv->pdev->dev, "enet-eee");
|
|
if (IS_ERR(priv->clk_eee)) {
|
|
if (IS_ERR(priv->clk_eee)) {
|
|
@@ -3257,8 +3257,7 @@ static int bcmgenet_probe(struct platform_device *pdev)
|
|
netif_carrier_off(dev);
|
|
netif_carrier_off(dev);
|
|
|
|
|
|
/* Turn off the main clock, WOL clock is handled separately */
|
|
/* Turn off the main clock, WOL clock is handled separately */
|
|
- if (!IS_ERR(priv->clk))
|
|
|
|
- clk_disable_unprepare(priv->clk);
|
|
|
|
|
|
+ clk_disable_unprepare(priv->clk);
|
|
|
|
|
|
err = register_netdev(dev);
|
|
err = register_netdev(dev);
|
|
if (err)
|
|
if (err)
|
|
@@ -3267,8 +3266,7 @@ static int bcmgenet_probe(struct platform_device *pdev)
|
|
return err;
|
|
return err;
|
|
|
|
|
|
err_clk_disable:
|
|
err_clk_disable:
|
|
- if (!IS_ERR(priv->clk))
|
|
|
|
- clk_disable_unprepare(priv->clk);
|
|
|
|
|
|
+ clk_disable_unprepare(priv->clk);
|
|
err:
|
|
err:
|
|
free_netdev(dev);
|
|
free_netdev(dev);
|
|
return err;
|
|
return err;
|