net: stmmac: Make stmmac_dvr_remove() return void
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Sat, 11 Feb 2023 11:24:30 +0000 (12:24 +0100)
committerJakub Kicinski <kuba@kernel.org>
Tue, 14 Feb 2023 03:50:43 +0000 (19:50 -0800)
The function returns zero unconditionally. Change it to return void instead
which simplifies some callers as error handing becomes unnecessary.

This also makes it more obvious that most platform remove callbacks always
return zero.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20230211112431.214252-1-u.kleine-koenig@pengutronix.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c
drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c
drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c
drivers/net/ethernet/stmicro/stmmac/stmmac.h
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c

index 80efdeeb0b594c2be222e85e711b9bf60559af03..87a2c1a186383c8f7122ac36ba51ba593f971799 100644 (file)
@@ -477,9 +477,7 @@ static int dwc_eth_dwmac_remove(struct platform_device *pdev)
 
        data = device_get_match_data(&pdev->dev);
 
-       err = stmmac_dvr_remove(&pdev->dev);
-       if (err < 0)
-               dev_err(&pdev->dev, "failed to remove platform: %d\n", err);
+       stmmac_dvr_remove(&pdev->dev);
 
        err = data->remove(pdev);
        if (err < 0)
index 6656d76b6766b2049ec93cf83145d7ed0121ee8c..4b8fd11563e494f859b7cf0e5ddf14917e711abf 100644 (file)
@@ -1915,11 +1915,12 @@ err_remove_config_dt:
 static int rk_gmac_remove(struct platform_device *pdev)
 {
        struct rk_priv_data *bsp_priv = get_stmmac_bsp_priv(&pdev->dev);
-       int ret = stmmac_dvr_remove(&pdev->dev);
+
+       stmmac_dvr_remove(&pdev->dev);
 
        rk_gmac_powerdown(bsp_priv);
 
-       return ret;
+       return 0;
 }
 
 #ifdef CONFIG_PM_SLEEP
index 710d7435733e1256fd5a2178cc4eba34972b6041..be3b1ebc06ab59f5706d647d9011f635f47537e9 100644 (file)
@@ -371,11 +371,12 @@ err_remove_config_dt:
 static int sti_dwmac_remove(struct platform_device *pdev)
 {
        struct sti_dwmac *dwmac = get_stmmac_bsp_priv(&pdev->dev);
-       int ret = stmmac_dvr_remove(&pdev->dev);
+
+       stmmac_dvr_remove(&pdev->dev);
 
        clk_disable_unprepare(dwmac->clk);
 
-       return ret;
+       return 0;
 }
 
 #ifdef CONFIG_PM_SLEEP
index 2b38a499a4045b84447339c20a99abd3e31e713c..0616b3a04ff3922ef5538c0c3f60e79611423112 100644 (file)
@@ -421,9 +421,10 @@ static int stm32_dwmac_remove(struct platform_device *pdev)
 {
        struct net_device *ndev = platform_get_drvdata(pdev);
        struct stmmac_priv *priv = netdev_priv(ndev);
-       int ret = stmmac_dvr_remove(&pdev->dev);
        struct stm32_dwmac *dwmac = priv->plat->bsp_priv;
 
+       stmmac_dvr_remove(&pdev->dev);
+
        stm32_dwmac_clk_disable(priv->plat->bsp_priv);
 
        if (dwmac->irq_pwr_wakeup >= 0) {
@@ -431,7 +432,7 @@ static int stm32_dwmac_remove(struct platform_device *pdev)
                device_init_wakeup(&pdev->dev, false);
        }
 
-       return ret;
+       return 0;
 }
 
 static int stm32mp1_suspend(struct stm32_dwmac *dwmac)
index bdbf86cb102af2f835f6c1239e63360ed1d90347..3d15e1e92e180ebf5687c17344b2101d7416f8da 100644 (file)
@@ -345,7 +345,7 @@ int stmmac_xdp_open(struct net_device *dev);
 void stmmac_xdp_release(struct net_device *dev);
 int stmmac_resume(struct device *dev);
 int stmmac_suspend(struct device *dev);
-int stmmac_dvr_remove(struct device *dev);
+void stmmac_dvr_remove(struct device *dev);
 int stmmac_dvr_probe(struct device *device,
                     struct plat_stmmacenet_data *plat_dat,
                     struct stmmac_resources *res);
index c05f16140320e3c2c962f3485ae79223cc945c90..e4902a7bb61eddad5bc7cc32f50854e301168756 100644 (file)
@@ -7352,7 +7352,7 @@ EXPORT_SYMBOL_GPL(stmmac_dvr_probe);
  * Description: this function resets the TX/RX processes, disables the MAC RX/TX
  * changes the link status, releases the DMA descriptor rings.
  */
-int stmmac_dvr_remove(struct device *dev)
+void stmmac_dvr_remove(struct device *dev)
 {
        struct net_device *ndev = dev_get_drvdata(dev);
        struct stmmac_priv *priv = netdev_priv(ndev);
@@ -7388,8 +7388,6 @@ int stmmac_dvr_remove(struct device *dev)
 
        pm_runtime_disable(dev);
        pm_runtime_put_noidle(dev);
-
-       return 0;
 }
 EXPORT_SYMBOL_GPL(stmmac_dvr_remove);
 
index eb6d9cd8e93f88770288ca902c07da3c4296caaf..5429531ae7c7950da359245ad283e3016fe6425a 100644 (file)
@@ -711,14 +711,15 @@ int stmmac_pltfr_remove(struct platform_device *pdev)
        struct net_device *ndev = platform_get_drvdata(pdev);
        struct stmmac_priv *priv = netdev_priv(ndev);
        struct plat_stmmacenet_data *plat = priv->plat;
-       int ret = stmmac_dvr_remove(&pdev->dev);
+
+       stmmac_dvr_remove(&pdev->dev);
 
        if (plat->exit)
                plat->exit(pdev, plat->bsp_priv);
 
        stmmac_remove_config_dt(pdev, plat);
 
-       return ret;
+       return 0;
 }
 EXPORT_SYMBOL_GPL(stmmac_pltfr_remove);