summaryrefslogtreecommitdiff
path: root/drivers/crypto/hisilicon/zip/zip_crypto.c
diff options
context:
space:
mode:
authorYang Shen <shenyang39@huawei.com>2020-08-15 12:56:17 +0300
committerHerbert Xu <herbert@gondor.apana.org.au>2020-08-21 07:47:53 +0300
commit3d29e98d1d7550fc959a7ad4258bd804b533b493 (patch)
treef734fb1ea3fa7c266e7decb2fa0134f890024f5d /drivers/crypto/hisilicon/zip/zip_crypto.c
parentdaa31783c0ebabac4fd6791a14b0f06239bde23c (diff)
downloadlinux-3d29e98d1d7550fc959a7ad4258bd804b533b493.tar.xz
crypto: hisilicon/qm - fix the process of register algorithms to crypto
When the devices are removed or not existing, the corresponding algorithms which are registered by 'hisi-zip' driver can't be used. Move 'hisi_zip_register_to_crypto' from 'hisi_zip_init' to 'hisi_zip_probe'. The algorithms will be registered to crypto only when there is device bind on the driver. And when the devices are removed, the algorithms will be unregistered. In the previous process, the function 'xxx_register_to_crypto' need a lock and a static variable to judge if the registration is the first time. Move this action into the function 'hisi_qm_alg_register'. Each device will call 'hisi_qm_alg_register' to add itself to qm list in probe process and registering algs when the qm list is empty. Signed-off-by: Yang Shen <shenyang39@huawei.com> Reviewed-by: Zhou Wang <wangzhou1@hisilicon.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/hisilicon/zip/zip_crypto.c')
-rw-r--r--drivers/crypto/hisilicon/zip/zip_crypto.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/crypto/hisilicon/zip/zip_crypto.c b/drivers/crypto/hisilicon/zip/zip_crypto.c
index 01fd6a78111d..aba1600fafc2 100644
--- a/drivers/crypto/hisilicon/zip/zip_crypto.c
+++ b/drivers/crypto/hisilicon/zip/zip_crypto.c
@@ -611,7 +611,7 @@ static struct acomp_alg hisi_zip_acomp_gzip = {
int hisi_zip_register_to_crypto(void)
{
- int ret = 0;
+ int ret;
ret = crypto_register_acomp(&hisi_zip_acomp_zlib);
if (ret) {