diff mbox series

[v4,08/19] firmware: turris-mox-rwtm: Use sysfs_emit() instead of sprintf()

Message ID 20240715104723.17751-9-kabel@kernel.org (mailing list archive)
State Superseded
Headers show
Series Updates for turris-mox-rwtm driver | expand

Commit Message

Marek BehĂșn July 15, 2024, 10:47 a.m. UTC
Use sysfs_emit() instead of sprintf() in sysfs attribute .show()
method.

Signed-off-by: Marek BehĂșn <kabel@kernel.org>
---
 drivers/firmware/turris-mox-rwtm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/firmware/turris-mox-rwtm.c b/drivers/firmware/turris-mox-rwtm.c
index 0da40f55c750..e3e209247e68 100644
--- a/drivers/firmware/turris-mox-rwtm.c
+++ b/drivers/firmware/turris-mox-rwtm.c
@@ -151,7 +151,7 @@  name##_show(struct kobject *kobj, struct kobj_attribute *a,	\
 	struct mox_rwtm *rwtm = to_rwtm(kobj);	\
 	if (!rwtm->has_##cat)					\
 		return -ENODATA;				\
-	return sprintf(buf, format, rwtm->name);		\
+	return sysfs_emit(buf, format, rwtm->name);		\
 }								\
 static struct kobj_attribute mox_attr_##name = __ATTR_RO(name)