summaryrefslogtreecommitdiff
path: root/drivers/staging/ccree/ssi_driver.c
diff options
context:
space:
mode:
authorGilad Ben-Yossef <gilad@benyossef.com>2017-12-14 17:02:44 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-12-19 17:15:54 +0300
commit3f268f5d6669b61e38ad65095480cdf80389ae40 (patch)
tree56c19c25533276d23d9014f772f11ad6adbe254c /drivers/staging/ccree/ssi_driver.c
parent829def33123ba001605c517fd01c9a3ca171694e (diff)
downloadlinux-3f268f5d6669b61e38ad65095480cdf80389ae40.tar.xz
staging: ccree: turn compile time debug log to params
The ccree driver has some support to dump runtime data to kernel log to assist in debugging. The code used to be enabled by a build time flag. Refactor to enable it via module/kernel parameters. Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/ccree/ssi_driver.c')
-rw-r--r--drivers/staging/ccree/ssi_driver.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/drivers/staging/ccree/ssi_driver.c b/drivers/staging/ccree/ssi_driver.c
index dbca24136cf5..195fb274d172 100644
--- a/drivers/staging/ccree/ssi_driver.c
+++ b/drivers/staging/ccree/ssi_driver.c
@@ -72,20 +72,26 @@
#include "ssi_pm.h"
#include "ssi_fips.h"
-#ifdef CC_DUMP_BYTES
-void dump_byte_array(const char *name, const u8 *buf, size_t len)
+bool cc_dump_desc;
+module_param_named(dump_desc, cc_dump_desc, bool, 0600);
+MODULE_PARM_DESC(cc_dump_desc, "Dump descriptors to kernel log as debugging aid");
+
+bool cc_dump_bytes;
+module_param_named(dump_bytes, cc_dump_bytes, bool, 0600);
+MODULE_PARM_DESC(cc_dump_bytes, "Dump buffers to kernel log as debugging aid");
+
+void __dump_byte_array(const char *name, const u8 *buf, size_t len)
{
- char prefix[NAME_LEN];
+ char prefix[64];
if (!buf)
return;
snprintf(prefix, sizeof(prefix), "%s[%lu]: ", name, len);
- print_hex_dump(KERN_DEBUG, prefix, DUMP_PREFIX_ADDRESS, 16, 1, len,
- false);
+ print_hex_dump(KERN_DEBUG, prefix, DUMP_PREFIX_ADDRESS, 16, 1, buf,
+ len, false);
}
-#endif
static irqreturn_t cc_isr(int irq, void *dev_id)
{