diff options
author | Shukun Tan <tanshukun1@huawei.com> | 2020-04-02 08:53:01 +0200 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2020-04-16 08:49:20 +0200 |
commit | 619e464ae22a17e6a060527c8591ccf78eb368ba (patch) | |
tree | f25f709c2bce71706f23b506af2f26f601444c3f /drivers/crypto/hisilicon/hpre/hpre_main.c | |
parent | MAINTAINERS: add HG as cctrng maintainer (diff) | |
download | linux-619e464ae22a17e6a060527c8591ccf78eb368ba.tar.xz linux-619e464ae22a17e6a060527c8591ccf78eb368ba.zip |
crypto: hisilicon - put vfs_num into struct hisi_qm
We plan to move vfs_num related code into qm.c, put the param
vfs_num into struct hisi_qm first.
Signed-off-by: Shukun Tan <tanshukun1@huawei.com>
Reviewed-by: Zhou Wang <wangzhou1@hisilicon.com>
Reviewed-by: Zaibo Xu <xuzaibo@huawei.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/hisilicon/hpre/hpre_main.c')
-rw-r--r-- | drivers/crypto/hisilicon/hpre/hpre_main.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/crypto/hisilicon/hpre/hpre_main.c b/drivers/crypto/hisilicon/hpre/hpre_main.c index 88be53bf4a38..5269e5b9be73 100644 --- a/drivers/crypto/hisilicon/hpre/hpre_main.c +++ b/drivers/crypto/hisilicon/hpre/hpre_main.c @@ -354,9 +354,7 @@ static u32 hpre_current_qm_read(struct hpre_debugfs_file *file) static int hpre_current_qm_write(struct hpre_debugfs_file *file, u32 val) { struct hisi_qm *qm = hpre_file_to_qm(file); - struct hpre_debug *debug = file->debug; - struct hpre *hpre = container_of(debug, struct hpre, debug); - u32 num_vfs = hpre->num_vfs; + u32 num_vfs = qm->vfs_num; u32 vfq_num, tmp; @@ -827,7 +825,7 @@ static int hpre_vf_q_assign(struct hpre *hpre, int num_vfs) static int hpre_clear_vft_config(struct hpre *hpre) { struct hisi_qm *qm = &hpre->qm; - u32 num_vfs = hpre->num_vfs; + u32 num_vfs = qm->vfs_num; int ret; u32 i; @@ -836,7 +834,7 @@ static int hpre_clear_vft_config(struct hpre *hpre) if (ret) return ret; } - hpre->num_vfs = 0; + qm->vfs_num = 0; return 0; } @@ -860,7 +858,7 @@ static int hpre_sriov_enable(struct pci_dev *pdev, int max_vfs) return ret; } - hpre->num_vfs = num_vfs; + hpre->qm.vfs_num = num_vfs; ret = pci_enable_sriov(pdev, num_vfs); if (ret) { @@ -903,7 +901,7 @@ static void hpre_remove(struct pci_dev *pdev) hpre_algs_unregister(); hisi_qm_del_from_list(qm, &hpre_devices); - if (qm->fun_type == QM_HW_PF && hpre->num_vfs != 0) { + if (qm->fun_type == QM_HW_PF && qm->vfs_num) { ret = hpre_sriov_disable(pdev); if (ret) { pci_err(pdev, "Disable SRIOV fail!\n"); |