crypto: qat - remove empty functions and turn qat_uregister fn to void
authorTadeusz Struk <tadeusz.struk@intel.com>
Tue, 22 Sep 2015 18:57:47 +0000 (11:57 -0700)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 1 Oct 2015 13:49:39 +0000 (21:49 +0800)
Some code cleanups after crypto API changes:
- Change qat_algs_unregister to a void function to keep it consistent
  with qat_asym_algs_unregister.
- Remove empty functions qat_algs_init & qat_algs_exit.

Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/qat/qat_common/adf_common_drv.h
drivers/crypto/qat/qat_common/adf_ctl_drv.c
drivers/crypto/qat/qat_common/adf_init.c
drivers/crypto/qat/qat_common/qat_algs.c

index 7836dffc3d4728abbe54dc0fc15af920cff9f84f..3f76bd495bcb5bca0a09ea4f80cf0b05edc10f82 100644 (file)
@@ -163,10 +163,8 @@ struct qat_crypto_instance *qat_crypto_get_instance_node(int node);
 void qat_crypto_put_instance(struct qat_crypto_instance *inst);
 void qat_alg_callback(void *resp);
 void qat_alg_asym_callback(void *resp);
-int qat_algs_init(void);
-void qat_algs_exit(void);
 int qat_algs_register(void);
-int qat_algs_unregister(void);
+void qat_algs_unregister(void);
 int qat_asym_algs_register(void);
 void qat_asym_algs_unregister(void);
 
index cd8a12af8ec53467019683d5ce962947eaa72f57..03856ad280b9349d650a0d06723a9f9da31e7c75 100644 (file)
@@ -463,9 +463,6 @@ static int __init adf_register_ctl_device_driver(void)
 {
        mutex_init(&adf_ctl_lock);
 
-       if (qat_algs_init())
-               goto err_algs_init;
-
        if (adf_chr_drv_create())
                goto err_chr_dev;
 
@@ -482,8 +479,6 @@ err_crypto_register:
 err_aer:
        adf_chr_drv_destroy();
 err_chr_dev:
-       qat_algs_exit();
-err_algs_init:
        mutex_destroy(&adf_ctl_lock);
        return -EFAULT;
 }
@@ -493,7 +488,6 @@ static void __exit adf_unregister_ctl_device_driver(void)
        adf_chr_drv_destroy();
        adf_exit_aer();
        qat_crypto_unregister();
-       qat_algs_exit();
        adf_clean_vf_map(false);
        mutex_destroy(&adf_ctl_lock);
 }
index ac37a89965acb6afa936c4949eb84b81bdca9d74..d873eeecc363c719c6d9eedc223187975be210a7 100644 (file)
@@ -272,12 +272,10 @@ int adf_dev_stop(struct adf_accel_dev *accel_dev)
        clear_bit(ADF_STATUS_STARTING, &accel_dev->status);
        clear_bit(ADF_STATUS_STARTED, &accel_dev->status);
 
-       if (!list_empty(&accel_dev->crypto_list) && qat_algs_unregister())
-               dev_err(&GET_DEV(accel_dev),
-                       "Failed to unregister crypto algs\n");
-
-       if (!list_empty(&accel_dev->crypto_list))
+       if (!list_empty(&accel_dev->crypto_list)) {
+               qat_algs_unregister();
                qat_asym_algs_unregister();
+       }
 
        list_for_each(list_itr, &service_table) {
                service = list_entry(list_itr, struct service_hndl, list);
index 2bd913aceaeb5c0370bc428d6c52278d1a4ecd78..9ed7bd5b860c5e0ff2460a90176bc9d76f604714 100644 (file)
@@ -1212,7 +1212,7 @@ unreg_algs:
        goto unlock;
 }
 
-int qat_algs_unregister(void)
+void qat_algs_unregister(void)
 {
        mutex_lock(&algs_lock);
        if (--active_devs != 0)
@@ -1223,14 +1223,4 @@ int qat_algs_unregister(void)
 
 unlock:
        mutex_unlock(&algs_lock);
-       return 0;
-}
-
-int qat_algs_init(void)
-{
-       return 0;
-}
-
-void qat_algs_exit(void)
-{
 }