diff mbox series

[net-next,v2] net: microchip: Make `lan743x_pm_suspend` function return right value

Message ID 20200923032140.16514-1-zhengyongjun3@huawei.com
State Accepted
Delegated to: David Miller
Headers show
Series [net-next,v2] net: microchip: Make `lan743x_pm_suspend` function return right value | expand

Commit Message

Zheng Yongjun Sept. 23, 2020, 3:21 a.m. UTC
drivers/net/ethernet/microchip/lan743x_main.c: In function lan743x_pm_suspend:

`ret` is set but not used. In fact, `pci_prepare_to_sleep` function value should
be the right value of `lan743x_pm_suspend` function, therefore, fix it.

Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
---
 drivers/net/ethernet/microchip/lan743x_main.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Comments

David Miller Sept. 23, 2020, 6:46 p.m. UTC | #1
From: Zheng Yongjun <zhengyongjun3@huawei.com>
Date: Wed, 23 Sep 2020 11:21:40 +0800

> drivers/net/ethernet/microchip/lan743x_main.c: In function lan743x_pm_suspend:
> 
> `ret` is set but not used. In fact, `pci_prepare_to_sleep` function value should
> be the right value of `lan743x_pm_suspend` function, therefore, fix it.
> 
> Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>

Applied.
diff mbox series

Patch

diff --git a/drivers/net/ethernet/microchip/lan743x_main.c b/drivers/net/ethernet/microchip/lan743x_main.c
index de93cc6ebc1a..7e236c9ee4b1 100644
--- a/drivers/net/ethernet/microchip/lan743x_main.c
+++ b/drivers/net/ethernet/microchip/lan743x_main.c
@@ -3038,7 +3038,6 @@  static int lan743x_pm_suspend(struct device *dev)
 	struct pci_dev *pdev = to_pci_dev(dev);
 	struct net_device *netdev = pci_get_drvdata(pdev);
 	struct lan743x_adapter *adapter = netdev_priv(netdev);
-	int ret;
 
 	lan743x_pcidev_shutdown(pdev);
 
@@ -3051,9 +3050,7 @@  static int lan743x_pm_suspend(struct device *dev)
 		lan743x_pm_set_wol(adapter);
 
 	/* Host sets PME_En, put D3hot */
-	ret = pci_prepare_to_sleep(pdev);
-
-	return 0;
+	return pci_prepare_to_sleep(pdev);;
 }
 
 static int lan743x_pm_resume(struct device *dev)