mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-25 00:52:45 -04:00
crypto: qat - relocate and rename get_service_enabled()
Move the function get_service_enabled() from adf_4xxx_hw_data.c to adf_cfg_services.c and rename it as adf_get_service_enabled(). This function is not specific to the 4xxx and will be used by other QAT drivers. This does not introduce any functional change. Signed-off-by: Jie Wang <jie.wang@intel.com> Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
@@ -2,6 +2,9 @@
|
||||
/* Copyright(c) 2023 Intel Corporation */
|
||||
|
||||
#include <linux/export.h>
|
||||
#include <linux/pci.h>
|
||||
#include <linux/string.h>
|
||||
#include "adf_cfg.h"
|
||||
#include "adf_cfg_services.h"
|
||||
#include "adf_cfg_strings.h"
|
||||
|
||||
@@ -18,3 +21,27 @@ const char *const adf_cfg_services[] = {
|
||||
[SVC_SYM_DC] = ADF_CFG_SYM_DC,
|
||||
};
|
||||
EXPORT_SYMBOL_GPL(adf_cfg_services);
|
||||
|
||||
int adf_get_service_enabled(struct adf_accel_dev *accel_dev)
|
||||
{
|
||||
char services[ADF_CFG_MAX_VAL_LEN_IN_BYTES] = {0};
|
||||
int ret;
|
||||
|
||||
ret = adf_cfg_get_param_value(accel_dev, ADF_GENERAL_SEC,
|
||||
ADF_SERVICES_ENABLED, services);
|
||||
if (ret) {
|
||||
dev_err(&GET_DEV(accel_dev),
|
||||
ADF_SERVICES_ENABLED " param not found\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = match_string(adf_cfg_services, ARRAY_SIZE(adf_cfg_services),
|
||||
services);
|
||||
if (ret < 0)
|
||||
dev_err(&GET_DEV(accel_dev),
|
||||
"Invalid value of " ADF_SERVICES_ENABLED " param: %s\n",
|
||||
services);
|
||||
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(adf_get_service_enabled);
|
||||
|
||||
Reference in New Issue
Block a user