Commit 7911c8bd authored by Leon Romanovsky's avatar Leon Romanovsky Committed by David S. Miller

ionic: Move devlink registration to be last devlink command

This change prevents from users to access device before devlink is
fully configured.
Signed-off-by: default avatarLeon Romanovsky <leonro@nvidia.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4f2a81c4
...@@ -82,7 +82,6 @@ int ionic_devlink_register(struct ionic *ionic) ...@@ -82,7 +82,6 @@ int ionic_devlink_register(struct ionic *ionic)
struct devlink_port_attrs attrs = {}; struct devlink_port_attrs attrs = {};
int err; int err;
devlink_register(dl);
attrs.flavour = DEVLINK_PORT_FLAVOUR_PHYSICAL; attrs.flavour = DEVLINK_PORT_FLAVOUR_PHYSICAL;
devlink_port_attrs_set(&ionic->dl_port, &attrs); devlink_port_attrs_set(&ionic->dl_port, &attrs);
err = devlink_port_register(dl, &ionic->dl_port, 0); err = devlink_port_register(dl, &ionic->dl_port, 0);
...@@ -93,6 +92,7 @@ int ionic_devlink_register(struct ionic *ionic) ...@@ -93,6 +92,7 @@ int ionic_devlink_register(struct ionic *ionic)
} }
devlink_port_type_eth_set(&ionic->dl_port, ionic->lif->netdev); devlink_port_type_eth_set(&ionic->dl_port, ionic->lif->netdev);
devlink_register(dl);
return 0; return 0;
} }
...@@ -100,6 +100,6 @@ void ionic_devlink_unregister(struct ionic *ionic) ...@@ -100,6 +100,6 @@ void ionic_devlink_unregister(struct ionic *ionic)
{ {
struct devlink *dl = priv_to_devlink(ionic); struct devlink *dl = priv_to_devlink(ionic);
devlink_port_unregister(&ionic->dl_port);
devlink_unregister(dl); devlink_unregister(dl);
devlink_port_unregister(&ionic->dl_port);
} }
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