Skip to content

Commit 60f9b5e

Browse files
tklauserdavem330
authored andcommitted
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. Signed-off-by: Tobias Klauser <tklauser@distanz.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent aa884a2 commit 60f9b5e

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

drivers/net/ethernet/xilinx/xilinx_emaclite.c

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,20 +1028,6 @@ static int xemaclite_send(struct sk_buff *orig_skb, struct net_device *dev)
10281028
return 0;
10291029
}
10301030

1031-
/**
1032-
* xemaclite_remove_ndev - Free the network device
1033-
* @ndev: Pointer to the network device to be freed
1034-
*
1035-
* This function un maps the IO region of the Emaclite device and frees the net
1036-
* device.
1037-
*/
1038-
static void xemaclite_remove_ndev(struct net_device *ndev)
1039-
{
1040-
if (ndev) {
1041-
free_netdev(ndev);
1042-
}
1043-
}
1044-
10451031
/**
10461032
* get_bool - Get a parameter from the OF device
10471033
* @ofdev: Pointer to OF device structure
@@ -1172,7 +1158,7 @@ static int xemaclite_of_probe(struct platform_device *ofdev)
11721158
return 0;
11731159

11741160
error:
1175-
xemaclite_remove_ndev(ndev);
1161+
free_netdev(ndev);
11761162
return rc;
11771163
}
11781164

@@ -1204,7 +1190,7 @@ static int xemaclite_of_remove(struct platform_device *of_dev)
12041190
of_node_put(lp->phy_node);
12051191
lp->phy_node = NULL;
12061192

1207-
xemaclite_remove_ndev(ndev);
1193+
free_netdev(ndev);
12081194

12091195
return 0;
12101196
}

0 commit comments

Comments
 (0)