tpm: WARN_ONCE() -> dev_warn_once() in tpm_tis_status()
Subsystems (3)
Jarkko Sakkinen
maintainerPATCH v2 1/1 tpm: WARN_ONCE() -> dev_warn_once() in tpm_tis_status()
An unexpected status from TPM chip is not irrecovable failure of the kernel. It's only undesirable situation. Thus, change the WARN_ONCE() instance inside tpm_tis_status() to dev_warn_once().
In addition: print the status in the log message because it is actually useful information lacking from the existing log message.
Suggested-by Guenter Roeck <[email protected]>
Reviewed-by Guenter Roeck <[email protected]>
Reviewed-by Stefan Berger <[email protected]>
Fixes 6f4f57f0b909 ("tpm: ibmvtpm: fix error return code in tpm_ibmvtpm_probe()")
Signed-off-by Jarkko Sakkinen <[email protected]>
---
v2:
- Use dev_warn_once() instead of pr_warn_once(), as suggested by Jason.
drivers/char/tpm/tpm_tis_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/char/tpm/tpm_tis_core.c +1 -1
@@ -202,7 +202,7 @@ static u8 tpm_tis_status(struct tpm_chip *chip)* acquired. Usually because tpm_try_get_ops() hasn't * been called before doing a TPM operation. */ -WARN_ONCE (1 ,"TPM returned invalid status\n" ); +dev_warn_once (&chip->dev,"TPM returned invalid status: 0x%x\n" , status);return 0 ; }
Signature · 1 line
2.30.0