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 4a4782b3cc1b1d2c5e615393a08737ae30f06509..a234044805977822958cbba81f716b2e69213294 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,