Skip to content

Commit ca8cf34

Browse files
ffainellidavem330
authored andcommitted
net: bcmgenet: propagate errors from bcmgenet_power_down
If bcmgenet_power_down() fails, we would want to propagate a return value from bcmgenet_wol_power_down_cfg() to know about this. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent cc330b5 commit ca8cf34

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

drivers/net/ethernet/broadcom/genet/bcmgenet.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -847,9 +847,10 @@ static struct ethtool_ops bcmgenet_ethtool_ops = {
847847
};
848848

849849
/* Power down the unimac, based on mode. */
850-
static void bcmgenet_power_down(struct bcmgenet_priv *priv,
850+
static int bcmgenet_power_down(struct bcmgenet_priv *priv,
851851
enum bcmgenet_power_mode mode)
852852
{
853+
int ret = 0;
853854
u32 reg;
854855

855856
switch (mode) {
@@ -858,7 +859,7 @@ static void bcmgenet_power_down(struct bcmgenet_priv *priv,
858859
break;
859860

860861
case GENET_POWER_WOL_MAGIC:
861-
bcmgenet_wol_power_down_cfg(priv, mode);
862+
ret = bcmgenet_wol_power_down_cfg(priv, mode);
862863
break;
863864

864865
case GENET_POWER_PASSIVE:
@@ -873,6 +874,8 @@ static void bcmgenet_power_down(struct bcmgenet_priv *priv,
873874
default:
874875
break;
875876
}
877+
878+
return 0;
876879
}
877880

878881
static void bcmgenet_power_up(struct bcmgenet_priv *priv,
@@ -2606,12 +2609,12 @@ static int bcmgenet_close(struct net_device *dev)
26062609
free_irq(priv->irq1, priv);
26072610

26082611
if (phy_is_internal(priv->phydev))
2609-
bcmgenet_power_down(priv, GENET_POWER_PASSIVE);
2612+
ret = bcmgenet_power_down(priv, GENET_POWER_PASSIVE);
26102613

26112614
if (!IS_ERR(priv->clk))
26122615
clk_disable_unprepare(priv->clk);
26132616

2614-
return 0;
2617+
return ret;
26152618
}
26162619

26172620
static void bcmgenet_timeout(struct net_device *dev)
@@ -3097,14 +3100,14 @@ static int bcmgenet_suspend(struct device *d)
30973100

30983101
/* Prepare the device for Wake-on-LAN and switch to the slow clock */
30993102
if (device_may_wakeup(d) && priv->wolopts) {
3100-
bcmgenet_power_down(priv, GENET_POWER_WOL_MAGIC);
3103+
ret = bcmgenet_power_down(priv, GENET_POWER_WOL_MAGIC);
31013104
clk_prepare_enable(priv->clk_wol);
31023105
}
31033106

31043107
/* Turn off the clocks */
31053108
clk_disable_unprepare(priv->clk);
31063109

3107-
return 0;
3110+
return ret;
31083111
}
31093112

31103113
static int bcmgenet_resume(struct device *d)

0 commit comments

Comments
 (0)