Skip to contentSkip to conversation

net: xilinx: emaclite: Remove xemaclite_remove_ndev()

PATCH Applied Tobias Klauser 2 participants 2 messages Jan 5, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: xilinx: emaclite: Remove xemaclite_remove_ndev()

xemaclite_remove_ndev() is a simple wrapper around free_netdev() checking for NULL before the call. All possible paths calling it are guaranteed to pass a non-NULL argument, so rather call free_netdev() directly.

---
 drivers/net/ethernet/xilinx/xilinx_emaclite.c | 18 ++----------------
 1 file changed, 2 insertions(+), 16 deletions(-)
drivers/net/ethernet/xilinx/xilinx_emaclite.c +2 -16
index 93dc10b10c09..97dcc0bd5a85 100644
@@ -1029,20 +1029,6 @@ static int xemaclite_send(struct sk_buff *orig_skb, struct net_device *dev)
 }
 
 /**
- * xemaclite_remove_ndev - Free the network device
- * @ndev:	Pointer to the network device to be freed
- *
- * This function un maps the IO region of the Emaclite device and frees the net
- * device.
- */
-static void xemaclite_remove_ndev(struct net_device *ndev)
-{
-	if (ndev) {
-		free_netdev(ndev);
-	}
-}
-
-/**
  * get_bool - Get a parameter from the OF device
  * @ofdev:	Pointer to OF device structure
  * @s:		Property to be retrieved
@@ -1172,7 +1158,7 @@ static int xemaclite_of_probe(struct platform_device *ofdev)
 	return 0;
 
 error:
-	xemaclite_remove_ndev(ndev);
+	free_netdev(ndev);
 	return rc;
 }
 
@@ -1204,7 +1190,7 @@ static int xemaclite_of_remove(struct platform_device *of_dev)
 	of_node_put(lp->phy_node);
 	lp->phy_node = NULL;
 
-	xemaclite_remove_ndev(ndev);
+	free_netdev(ndev);
 
 	return 0;
 }
Signature · 1 line
2.11.0
maintainer Applied
#1 lore raw

From: Tobias Klauser <[email protected]>
Date: Thu, 5 Jan 2017 10:41:36 +0100

Quoted 6 lines

xemaclite_remove_ndev() is a simple wrapper around free_netdev() checking for NULL before the call. All possible paths calling it are guaranteed to pass a non-NULL argument, so rather call free_netdev() directly.

Applied.