Commit 4f99de7b authored by Jiri Pirko's avatar Jiri Pirko Committed by Jakub Kicinski

funeth: remove pointless check of devlink pointer in create/destroy_netdev() flows

Once devlink port is successfully registered, the devlink pointer is not
NULL. Therefore, the check is going to be always true and therefore
pointless. Remove it.
Signed-off-by: default avatarJiri Pirko <jiri@nvidia.com>
Acked-by: default avatarDimitris Michailidis <dmichail@fungible.com>
Link: https://lore.kernel.org/r/20220826110411.1409446-1-jiri@resnulli.usSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 1390d912
......@@ -1802,7 +1802,6 @@ static int fun_create_netdev(struct fun_ethdev *ed, unsigned int portid)
if (rc)
goto unreg_devlink;
if (fp->dl_port.devlink)
devlink_port_type_eth_set(&fp->dl_port, netdev);
return 0;
......@@ -1810,7 +1809,6 @@ static int fun_create_netdev(struct fun_ethdev *ed, unsigned int portid)
unreg_devlink:
ed->netdevs[portid] = NULL;
fun_ktls_cleanup(fp);
if (fp->dl_port.devlink)
devlink_port_unregister(&fp->dl_port);
free_stats:
fun_free_stats_area(fp);
......@@ -1830,10 +1828,8 @@ static void fun_destroy_netdev(struct net_device *netdev)
struct funeth_priv *fp;
fp = netdev_priv(netdev);
if (fp->dl_port.devlink) {
devlink_port_type_clear(&fp->dl_port);
devlink_port_unregister(&fp->dl_port);
}
unregister_netdev(netdev);
fun_ktls_cleanup(fp);
fun_free_stats_area(fp);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment