lkml.org 
[lkml]   [2011]   [Aug]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subjecttpm: suppress durations sysfs output if not set
Suppress the output of durations if they were not read during driver 
initialization.
This is similar to other sysfs entries that return nothing if for some
reason sending the commands to the TPM fails.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>

---
drivers/char/tpm/tpm.c | 3 +++
1 file changed, 3 insertions(+)

Index: linux-2.6/drivers/char/tpm/tpm.c
===================================================================
--- linux-2.6.orig/drivers/char/tpm/tpm.c
+++ linux-2.6/drivers/char/tpm/tpm.c
@@ -963,6 +963,9 @@ ssize_t tpm_show_durations(struct device
{
struct tpm_chip *chip = dev_get_drvdata(dev);

+ if (chip->vendor.duration[TPM_LONG] == 0)
+ return 0;
+
return sprintf(buf, "%d %d %d [%s]\n",
jiffies_to_usecs(chip->vendor.duration[TPM_SHORT]),
jiffies_to_usecs(chip->vendor.duration[TPM_MEDIUM]),

\
 
 \ /
  Last update: 2011-08-22 12:51    [W:0.178 / U:0.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site