net: bcmgenet: return correct value 'ret' from bcmgenet_power_down
authorYueHaibing <yuehaibing@huawei.com>
Thu, 8 Nov 2018 02:08:43 +0000 (02:08 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Nov 2019 17:29:01 +0000 (18:29 +0100)
[ Upstream commit 0db55093b56618088b9a1d445eb6e43b311bea33 ]

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/net/ethernet/broadcom/genet/bcmgenet.c: In function 'bcmgenet_power_down':
drivers/net/ethernet/broadcom/genet/bcmgenet.c:1136:6: warning:
 variable 'ret' set but not used [-Wunused-but-set-variable]

bcmgenet_power_down should return 'ret' instead of 0.

Fixes: ca8cf341903f ("net: bcmgenet: propagate errors from bcmgenet_power_down")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/broadcom/genet/bcmgenet.c

index 4a4782b..a234044 100644 (file)
@@ -1078,7 +1078,7 @@ static int bcmgenet_power_down(struct bcmgenet_priv *priv,
                break;
        }
 
-       return 0;
+       return ret;
 }
 
 static void bcmgenet_power_up(struct bcmgenet_priv *priv,