Skip to content

Commit

Permalink
crypto: hisilicon/qm - merges the work initialization process into a …
Browse files Browse the repository at this point in the history
…single function

Merges the work initialization process into a single function from
qm initialization.

Signed-off-by: Kai Ye <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
yekai123123 authored and herbertx committed Jun 17, 2021
1 parent cc0c40c commit 362c50b
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions drivers/crypto/hisilicon/qm.c
Original file line number Diff line number Diff line change
Expand Up @@ -5317,6 +5317,16 @@ static int hisi_qm_pci_init(struct hisi_qm *qm)
return ret;
}

static void hisi_qm_init_work(struct hisi_qm *qm)
{
INIT_WORK(&qm->work, qm_work_process);
if (qm->fun_type == QM_HW_PF)
INIT_WORK(&qm->rst_work, hisi_qm_controller_reset);

if (qm->ver > QM_HW_V2)
INIT_WORK(&qm->cmd_process, qm_cmd_process);
}

static int hisi_qp_alloc_memory(struct hisi_qm *qm)
{
struct device *dev = &qm->pdev->dev;
Expand Down Expand Up @@ -5432,13 +5442,7 @@ int hisi_qm_init(struct hisi_qm *qm)
if (ret)
goto err_alloc_uacce;

INIT_WORK(&qm->work, qm_work_process);
if (qm->fun_type == QM_HW_PF)
INIT_WORK(&qm->rst_work, hisi_qm_controller_reset);

if (qm->ver >= QM_HW_V3)
INIT_WORK(&qm->cmd_process, qm_cmd_process);

hisi_qm_init_work(qm);
qm_cmd_init(qm);
atomic_set(&qm->status.flags, QM_INIT);

Expand Down

0 comments on commit 362c50b

Please sign in to comment.