Commit 1b8e0bdb authored by Leon Romanovsky's avatar Leon Romanovsky Committed by David S. Miller

qed: 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 7911c8bd
...@@ -215,7 +215,6 @@ struct devlink *qed_devlink_register(struct qed_dev *cdev) ...@@ -215,7 +215,6 @@ struct devlink *qed_devlink_register(struct qed_dev *cdev)
qdevlink = devlink_priv(dl); qdevlink = devlink_priv(dl);
qdevlink->cdev = cdev; qdevlink->cdev = cdev;
devlink_register(dl);
rc = devlink_params_register(dl, qed_devlink_params, rc = devlink_params_register(dl, qed_devlink_params,
ARRAY_SIZE(qed_devlink_params)); ARRAY_SIZE(qed_devlink_params));
if (rc) if (rc)
...@@ -226,15 +225,13 @@ struct devlink *qed_devlink_register(struct qed_dev *cdev) ...@@ -226,15 +225,13 @@ struct devlink *qed_devlink_register(struct qed_dev *cdev)
QED_DEVLINK_PARAM_ID_IWARP_CMT, QED_DEVLINK_PARAM_ID_IWARP_CMT,
value); value);
devlink_params_publish(dl);
cdev->iwarp_cmt = false; cdev->iwarp_cmt = false;
qed_fw_reporters_create(dl); qed_fw_reporters_create(dl);
devlink_register(dl);
return dl; return dl;
err_unregister: err_unregister:
devlink_unregister(dl);
devlink_free(dl); devlink_free(dl);
return ERR_PTR(rc); return ERR_PTR(rc);
...@@ -245,11 +242,11 @@ void qed_devlink_unregister(struct devlink *devlink) ...@@ -245,11 +242,11 @@ void qed_devlink_unregister(struct devlink *devlink)
if (!devlink) if (!devlink)
return; return;
devlink_unregister(devlink);
qed_fw_reporters_destroy(devlink); qed_fw_reporters_destroy(devlink);
devlink_params_unregister(devlink, qed_devlink_params, devlink_params_unregister(devlink, qed_devlink_params,
ARRAY_SIZE(qed_devlink_params)); ARRAY_SIZE(qed_devlink_params));
devlink_unregister(devlink);
devlink_free(devlink); devlink_free(devlink);
} }
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