net: arc: Make arc_emac_remove() return void
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Thu, 18 May 2023 20:30:49 +0000 (22:30 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 19 May 2023 12:33:28 +0000 (13:33 +0100)
The function returns zero unconditionally. Change it to return void instead
which simplifies its callers as error handing becomes unnecessary.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/arc/emac.h
drivers/net/ethernet/arc/emac_arc.c
drivers/net/ethernet/arc/emac_main.c
drivers/net/ethernet/arc/emac_rockchip.c

index d820ae03a9660df1672ba6b51aa538cfd8265210..0e244f0e25fd36c757ba80999a84a1249dee31cf 100644 (file)
@@ -220,6 +220,6 @@ static inline void arc_reg_clr(struct arc_emac_priv *priv, int reg, int mask)
 int arc_mdio_probe(struct arc_emac_priv *priv);
 int arc_mdio_remove(struct arc_emac_priv *priv);
 int arc_emac_probe(struct net_device *ndev, int interface);
-int arc_emac_remove(struct net_device *ndev);
+void arc_emac_remove(struct net_device *ndev);
 
 #endif /* ARC_EMAC_H */
index 800620b8f10d41e2094fb5c28d25bab24302a30d..ce3147e886a10ddb3c50b3df7b260a8e8ffa210b 100644 (file)
@@ -61,11 +61,11 @@ out_netdev:
 static int emac_arc_remove(struct platform_device *pdev)
 {
        struct net_device *ndev = platform_get_drvdata(pdev);
-       int err;
 
-       err = arc_emac_remove(ndev);
+       arc_emac_remove(ndev);
        free_netdev(ndev);
-       return err;
+
+       return 0;
 }
 
 static const struct of_device_id emac_arc_dt_ids[] = {
index ba0646b3b122e9a79b05d7c72fb4c441f23a432b..2b427d8a18315215344838bebccf7d9ff3e91226 100644 (file)
@@ -1008,7 +1008,7 @@ out_put_node:
 }
 EXPORT_SYMBOL_GPL(arc_emac_probe);
 
-int arc_emac_remove(struct net_device *ndev)
+void arc_emac_remove(struct net_device *ndev)
 {
        struct arc_emac_priv *priv = netdev_priv(ndev);
 
@@ -1019,8 +1019,6 @@ int arc_emac_remove(struct net_device *ndev)
 
        if (!IS_ERR(priv->clk))
                clk_disable_unprepare(priv->clk);
-
-       return 0;
 }
 EXPORT_SYMBOL_GPL(arc_emac_remove);
 
index 1c9ca3bcb87147d49811ca5cb2bcfafd1c5bda34..509101112279d7618e0d3fa631a3ca9920eff866 100644 (file)
@@ -248,9 +248,8 @@ static int emac_rockchip_remove(struct platform_device *pdev)
 {
        struct net_device *ndev = platform_get_drvdata(pdev);
        struct rockchip_priv_data *priv = netdev_priv(ndev);
-       int err;
 
-       err = arc_emac_remove(ndev);
+       arc_emac_remove(ndev);
 
        clk_disable_unprepare(priv->refclk);
 
@@ -261,7 +260,7 @@ static int emac_rockchip_remove(struct platform_device *pdev)
                clk_disable_unprepare(priv->macclk);
 
        free_netdev(ndev);
-       return err;
+       return 0;
 }
 
 static struct platform_driver emac_rockchip_driver = {