mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 14:53:58 -04:00
crypto: hisilicon - consolidate qp creation and start in hisi_qm_alloc_qps_node
Consolidate the creation and start of qp into the function hisi_qm_alloc_qps_node. This change eliminates the need for each module to perform these steps in two separate phases (creation and start). Signed-off-by: Chenghai Huang <huangchenghai2@huawei.com> Signed-off-by: Weili Qian <qianweili@huawei.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
committed by
Herbert Xu
parent
8cd9b608ee
commit
72f3bbebff
@@ -626,7 +626,6 @@ static int sec_create_qp_ctx(struct sec_ctx *ctx, int qp_ctx_id)
|
||||
|
||||
qp_ctx = &ctx->qp_ctx[qp_ctx_id];
|
||||
qp = ctx->qps[qp_ctx_id];
|
||||
qp->qp_ctx = qp_ctx;
|
||||
qp_ctx->qp = qp;
|
||||
qp_ctx->ctx = ctx;
|
||||
|
||||
@@ -644,14 +643,8 @@ static int sec_create_qp_ctx(struct sec_ctx *ctx, int qp_ctx_id)
|
||||
if (ret)
|
||||
goto err_destroy_idr;
|
||||
|
||||
ret = hisi_qm_start_qp(qp, 0);
|
||||
if (ret < 0)
|
||||
goto err_resource_free;
|
||||
|
||||
return 0;
|
||||
|
||||
err_resource_free:
|
||||
sec_free_qp_ctx_resource(ctx, qp_ctx);
|
||||
err_destroy_idr:
|
||||
idr_destroy(&qp_ctx->req_idr);
|
||||
return ret;
|
||||
@@ -660,7 +653,6 @@ err_destroy_idr:
|
||||
static void sec_release_qp_ctx(struct sec_ctx *ctx,
|
||||
struct sec_qp_ctx *qp_ctx)
|
||||
{
|
||||
hisi_qm_stop_qp(qp_ctx->qp);
|
||||
sec_free_qp_ctx_resource(ctx, qp_ctx);
|
||||
idr_destroy(&qp_ctx->req_idr);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user