Skip to contentSkip to conversation

tpm: Redefine pr_fmt

PATCH New Jarkko Sakkinen 1 participant 1 message Jun 8, 2023

Subsystems (2)
lore
Share & tools
lore

Jarkko Sakkinen

author maintainer
#0 lore raw

PATCH 1/1 tpm: Redefine pr_fmt

Redefine pr_fmt inside internal include, following the pattern from arch/x86/kernel/cpu/sgx.h.

---
 drivers/char/tpm/tpm-interface.c | 4 ++--
 drivers/char/tpm/tpm.h           | 4 ++++
 2 files changed, 6 insertions(+), 2 deletions(-)
drivers/char/tpm/tpm-interface.c +2 -2
index 586ca10b0d72..0689e5f3b4c0 100644
@@ -493,13 +493,13 @@ static int __init tpm_init(void)
 
 	rc = alloc_chrdev_region(&tpm_devt, 0, 2*TPM_NUM_DEVICES, "tpm");
 	if (rc < 0) {
-		pr_err("tpm: failed to allocate char dev region\n");
+		pr_err("failed to allocate char dev region\n");
 		goto out_destroy_tpmrm_class;
 	}
 
 	rc = tpm_dev_common_init();
 	if (rc) {
-		pr_err("tpm: failed to allocate char dev region\n");
+		pr_err("failed to allocate char dev region\n");
 		goto out_unreg_chrdev;
 	}
 
drivers/char/tpm/tpm.h +4 -0
index 460bb85dd142..13733474a235 100644
@@ -27,6 +27,10 @@
 #include <linux/tpm.h>
 #include <linux/tpm_eventlog.h>
 
+
+#undef pr_fmt
+#define pr_fmt(fmt) "tpm: " fmt
+
 #ifdef CONFIG_X86
 #include <asm/intel-family.h>
 #endif
Signature · 1 line
2.39.2