Thread (80 messages) 80 messages, 5 authors, 2024-08-28

Re: [PATCH v9 17/19] tpm: Add sysfs interface to allow setting and querying the preferred locality

From: "Jarkko Sakkinen" <jarkko@kernel.org>
Date: 2024-06-04 20:27:47
Also in: kexec, linux-crypto, linux-efi, linux-integrity, lkml

On Fri May 31, 2024 at 4:03 AM EEST, Ross Philipson wrote:
quoted hunk ↗ jump to hunk
Expose a sysfs interface to allow user mode to set and query the preferred
locality for the TPM chip.

Signed-off-by: Ross Philipson <redacted>
---
 drivers/char/tpm/tpm-sysfs.c | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)
diff --git a/drivers/char/tpm/tpm-sysfs.c b/drivers/char/tpm/tpm-sysfs.c
index 94231f052ea7..5f4a966a4599 100644
--- a/drivers/char/tpm/tpm-sysfs.c
+++ b/drivers/char/tpm/tpm-sysfs.c
@@ -324,6 +324,34 @@ static ssize_t null_name_show(struct device *dev, struct device_attribute *attr,
 static DEVICE_ATTR_RO(null_name);
 #endif
 
+static ssize_t preferred_locality_show(struct device *dev,
+				       struct device_attribute *attr, char *buf)
+{
+	struct tpm_chip *chip = to_tpm_chip(dev);
+
+	return sprintf(buf, "%d\n", chip->pref_locality);
+}
Disagree with the naming.

BR, Jarkko
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help