Commit be2cfac0 authored by Tadeusz Struk's avatar Tadeusz Struk Committed by Herbert Xu

crypto: qat - remove empty functions and turn qat_uregister fn to void

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: default avatarTadeusz Struk <tadeusz.struk@intel.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 97bce7e0
...@@ -163,10 +163,8 @@ struct qat_crypto_instance *qat_crypto_get_instance_node(int node); ...@@ -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_crypto_put_instance(struct qat_crypto_instance *inst);
void qat_alg_callback(void *resp); void qat_alg_callback(void *resp);
void qat_alg_asym_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_register(void);
int qat_algs_unregister(void); void qat_algs_unregister(void);
int qat_asym_algs_register(void); int qat_asym_algs_register(void);
void qat_asym_algs_unregister(void); void qat_asym_algs_unregister(void);
......
...@@ -463,9 +463,6 @@ static int __init adf_register_ctl_device_driver(void) ...@@ -463,9 +463,6 @@ static int __init adf_register_ctl_device_driver(void)
{ {
mutex_init(&adf_ctl_lock); mutex_init(&adf_ctl_lock);
if (qat_algs_init())
goto err_algs_init;
if (adf_chr_drv_create()) if (adf_chr_drv_create())
goto err_chr_dev; goto err_chr_dev;
...@@ -482,8 +479,6 @@ static int __init adf_register_ctl_device_driver(void) ...@@ -482,8 +479,6 @@ static int __init adf_register_ctl_device_driver(void)
err_aer: err_aer:
adf_chr_drv_destroy(); adf_chr_drv_destroy();
err_chr_dev: err_chr_dev:
qat_algs_exit();
err_algs_init:
mutex_destroy(&adf_ctl_lock); mutex_destroy(&adf_ctl_lock);
return -EFAULT; return -EFAULT;
} }
...@@ -493,7 +488,6 @@ static void __exit adf_unregister_ctl_device_driver(void) ...@@ -493,7 +488,6 @@ static void __exit adf_unregister_ctl_device_driver(void)
adf_chr_drv_destroy(); adf_chr_drv_destroy();
adf_exit_aer(); adf_exit_aer();
qat_crypto_unregister(); qat_crypto_unregister();
qat_algs_exit();
adf_clean_vf_map(false); adf_clean_vf_map(false);
mutex_destroy(&adf_ctl_lock); mutex_destroy(&adf_ctl_lock);
} }
......
...@@ -272,12 +272,10 @@ int adf_dev_stop(struct adf_accel_dev *accel_dev) ...@@ -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_STARTING, &accel_dev->status);
clear_bit(ADF_STATUS_STARTED, &accel_dev->status); clear_bit(ADF_STATUS_STARTED, &accel_dev->status);
if (!list_empty(&accel_dev->crypto_list) && qat_algs_unregister()) if (!list_empty(&accel_dev->crypto_list)) {
dev_err(&GET_DEV(accel_dev), qat_algs_unregister();
"Failed to unregister crypto algs\n");
if (!list_empty(&accel_dev->crypto_list))
qat_asym_algs_unregister(); qat_asym_algs_unregister();
}
list_for_each(list_itr, &service_table) { list_for_each(list_itr, &service_table) {
service = list_entry(list_itr, struct service_hndl, list); service = list_entry(list_itr, struct service_hndl, list);
......
...@@ -1212,7 +1212,7 @@ int qat_algs_register(void) ...@@ -1212,7 +1212,7 @@ int qat_algs_register(void)
goto unlock; goto unlock;
} }
int qat_algs_unregister(void) void qat_algs_unregister(void)
{ {
mutex_lock(&algs_lock); mutex_lock(&algs_lock);
if (--active_devs != 0) if (--active_devs != 0)
...@@ -1223,14 +1223,4 @@ int qat_algs_unregister(void) ...@@ -1223,14 +1223,4 @@ int qat_algs_unregister(void)
unlock: unlock:
mutex_unlock(&algs_lock); mutex_unlock(&algs_lock);
return 0;
}
int qat_algs_init(void)
{
return 0;
}
void qat_algs_exit(void)
{
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment