Commit 1fd7c082 authored by Jiri Pirko's avatar Jiri Pirko Committed by Jakub Kicinski

ionic: change order of devlink port register and netdev register

Make sure that devlink port is registered first and register netdev
after. Unregister netdev before devlnk port unregister.
Signed-off-by: default avatarJiri Pirko <jiri@nvidia.com>
Acked-by: default avatarShannon Nelson <snelson@pensando.io>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent a286ba73
...@@ -320,16 +320,16 @@ static int ionic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -320,16 +320,16 @@ static int ionic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
dev_err(dev, "Cannot enable existing VFs: %d\n", err); dev_err(dev, "Cannot enable existing VFs: %d\n", err);
} }
err = ionic_lif_register(ionic->lif); err = ionic_devlink_register(ionic);
if (err) { if (err) {
dev_err(dev, "Cannot register LIF: %d, aborting\n", err); dev_err(dev, "Cannot register devlink: %d\n", err);
goto err_out_deinit_lifs; goto err_out_deinit_lifs;
} }
err = ionic_devlink_register(ionic); err = ionic_lif_register(ionic->lif);
if (err) { if (err) {
dev_err(dev, "Cannot register devlink: %d\n", err); dev_err(dev, "Cannot register LIF: %d, aborting\n", err);
goto err_out_deregister_lifs; goto err_out_deregister_devlink;
} }
mod_timer(&ionic->watchdog_timer, mod_timer(&ionic->watchdog_timer,
...@@ -337,8 +337,8 @@ static int ionic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -337,8 +337,8 @@ static int ionic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
return 0; return 0;
err_out_deregister_lifs: err_out_deregister_devlink:
ionic_lif_unregister(ionic->lif); ionic_devlink_unregister(ionic);
err_out_deinit_lifs: err_out_deinit_lifs:
ionic_vf_dealloc(ionic); ionic_vf_dealloc(ionic);
ionic_lif_deinit(ionic->lif); ionic_lif_deinit(ionic->lif);
...@@ -380,8 +380,8 @@ static void ionic_remove(struct pci_dev *pdev) ...@@ -380,8 +380,8 @@ static void ionic_remove(struct pci_dev *pdev)
del_timer_sync(&ionic->watchdog_timer); del_timer_sync(&ionic->watchdog_timer);
if (ionic->lif) { if (ionic->lif) {
ionic_devlink_unregister(ionic);
ionic_lif_unregister(ionic->lif); ionic_lif_unregister(ionic->lif);
ionic_devlink_unregister(ionic);
ionic_lif_deinit(ionic->lif); ionic_lif_deinit(ionic->lif);
ionic_lif_free(ionic->lif); ionic_lif_free(ionic->lif);
ionic->lif = NULL; ionic->lif = NULL;
......
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