crypto: qat - move dbgfs init to separate file
authorDamian Muszynski <damian.muszynski@intel.com>
Fri, 26 May 2023 16:48:59 +0000 (17:48 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 2 Jun 2023 10:21:32 +0000 (18:21 +0800)
commit9260db6640a61ebba5348ceae7fa26307d9d5b0e
treed0c377f4f3b8e987c69108b01f8a563472aaa538
parent755b4e7f7c224e10af10edafe34577b5512f7cbb
crypto: qat - move dbgfs init to separate file

Move initialization of debugfs entries to a separate file.
This simplifies the exclusion of the debugfs logic in the QAT driver
when the kernel is built with CONFIG_DEBUG_FS=n.
In addition, it will allow to consolidate the addition of debugfs
entries to a single location in the code.

This implementation adds infrastructure to create (and remove) debugfs
entries at two different stages. The first, done when a device is probed,
allows to keep debugfs entries persistent between a transition in device
state (up to down or vice versa). The second, done after the initialization
phase, allows to have debugfs entries that are accessible only when
the device is up.

In addition, move the creation of debugfs entries for configuration
to the newly created function adf_dbgfs_init() and replace symbolic
permissions with octal permissions when creating the debugfs files.
This is to resolve the following warning reported by checkpatch:

  WARNING: Symbolic permissions 'S_IRUSR' are not preferred. Consider using octal permissions '0400'.

Signed-off-by: Damian Muszynski <damian.muszynski@intel.com>
Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Signed-off-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
13 files changed:
drivers/crypto/intel/qat/qat_4xxx/adf_drv.c
drivers/crypto/intel/qat/qat_c3xxx/adf_drv.c
drivers/crypto/intel/qat/qat_c3xxxvf/adf_drv.c
drivers/crypto/intel/qat/qat_c62x/adf_drv.c
drivers/crypto/intel/qat/qat_c62xvf/adf_drv.c
drivers/crypto/intel/qat/qat_common/Makefile
drivers/crypto/intel/qat/qat_common/adf_cfg.c
drivers/crypto/intel/qat/qat_common/adf_cfg.h
drivers/crypto/intel/qat/qat_common/adf_dbgfs.c [new file with mode: 0644]
drivers/crypto/intel/qat/qat_common/adf_dbgfs.h [new file with mode: 0644]
drivers/crypto/intel/qat/qat_common/adf_init.c
drivers/crypto/intel/qat/qat_dh895xcc/adf_drv.c
drivers/crypto/intel/qat/qat_dh895xccvf/adf_drv.c