drivers: tee: improve sysfs interface by using sysfs_emit()

Replace scnprintf() with sysfs_emit() while formatting buffer that is
passed to userspace as per the recommendation in
Documentation/filesystems/sysfs.rst. sysfs _show() callbacks should use
sysfs_emit() or sysfs_emit_at() while returning values to the userspace.
This change does not impact functionality, but aligns with sysfs
interface usage guidelines for the tee driver.

Signed-off-by: Akhilesh Patil <akhilesh@ee.iitb.ac.in>
Reviewed-by: Sumit Garg <sumit.garg@oss.qualcomm.com>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
This commit is contained in:
Akhilesh Patil
2025-07-18 21:00:13 +05:30
committed by Jens Wiklander
parent 038d61fd64
commit 1faa0d62a1
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -72,7 +72,7 @@ static ssize_t rpmb_routing_model_show(struct device *dev,
else
s = "user";
return scnprintf(buf, PAGE_SIZE, "%s\n", s);
return sysfs_emit(buf, "%s\n", s);
}
static DEVICE_ATTR_RO(rpmb_routing_model);
+1 -1
View File
@@ -977,7 +977,7 @@ static ssize_t implementation_id_show(struct device *dev,
struct tee_ioctl_version_data vers;
teedev->desc->ops->get_version(teedev, &vers);
return scnprintf(buf, PAGE_SIZE, "%d\n", vers.impl_id);
return sysfs_emit(buf, "%d\n", vers.impl_id);
}
static DEVICE_ATTR_RO(implementation_id);