aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet
diff options
context:
space:
mode:
authorLeon Romanovsky <leonro@nvidia.com>2021-09-25 14:22:54 +0300
committerDavid S. Miller <davem@davemloft.net>2021-09-27 16:31:59 +0100
commit7911c8bd546fa85e408544426646dd1f1a684286 (patch)
tree55d89c72871f7b74b04a45234a57c1d5f1981560 /drivers/net/ethernet
parentnfp: Move delink_register to be last command (diff)
downloadlinux-dev-7911c8bd546fa85e408544426646dd1f1a684286.tar.xz
linux-dev-7911c8bd546fa85e408544426646dd1f1a684286.zip
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: Leon Romanovsky <leonro@nvidia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r--drivers/net/ethernet/pensando/ionic/ionic_devlink.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/pensando/ionic/ionic_devlink.c b/drivers/net/ethernet/pensando/ionic/ionic_devlink.c
index 93282394d332..2267da95640b 100644
--- a/drivers/net/ethernet/pensando/ionic/ionic_devlink.c
+++ b/drivers/net/ethernet/pensando/ionic/ionic_devlink.c
@@ -82,7 +82,6 @@ int ionic_devlink_register(struct ionic *ionic)
struct devlink_port_attrs attrs = {};
int err;
- devlink_register(dl);
attrs.flavour = DEVLINK_PORT_FLAVOUR_PHYSICAL;
devlink_port_attrs_set(&ionic->dl_port, &attrs);
err = devlink_port_register(dl, &ionic->dl_port, 0);
@@ -93,6 +92,7 @@ int ionic_devlink_register(struct ionic *ionic)
}
devlink_port_type_eth_set(&ionic->dl_port, ionic->lif->netdev);
+ devlink_register(dl);
return 0;
}
@@ -100,6 +100,6 @@ void ionic_devlink_unregister(struct ionic *ionic)
{
struct devlink *dl = priv_to_devlink(ionic);
- devlink_port_unregister(&ionic->dl_port);
devlink_unregister(dl);
+ devlink_port_unregister(&ionic->dl_port);
}