[PATCH 12/12] rtc: rs5c372: use sysfs_emit() instead of sprintf()

From: alexandre . belloni

Date: Thu Oct 29 2026 - 09:41:25 EST


From: Alexandre Belloni <alexandre.belloni@xxxxxxxxxxx>

Use sysfs_emit() instead of sprintf() in sysfs show callbacks
(rs5c372_sysfs_show_trim and rs5c372_sysfs_show_osc) to conform to the
recommended sysfs attribute formatting guidelines in
Documentation/filesystems/sysfs.rst.

Signed-off-by: Alexandre Belloni <alexandre.belloni@xxxxxxxxxxx>
---
drivers/rtc/rtc-rs5c372.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/rtc/rtc-rs5c372.c b/drivers/rtc/rtc-rs5c372.c
index 9ab6f2c28f7b..a4bd042908b8 100644
--- a/drivers/rtc/rtc-rs5c372.c
+++ b/drivers/rtc/rtc-rs5c372.c
@@ -699,7 +699,7 @@ static ssize_t rs5c372_sysfs_show_trim(struct device *dev,
if (err)
return err;

- return sprintf(buf, "%d\n", trim);
+ return sysfs_emit(buf, "%d\n", trim);
}
static DEVICE_ATTR(trim, S_IRUGO, rs5c372_sysfs_show_trim, NULL);

@@ -712,7 +712,7 @@ static ssize_t rs5c372_sysfs_show_osc(struct device *dev,
if (err)
return err;

- return sprintf(buf, "%d.%03d KHz\n", osc / 1000, osc % 1000);
+ return sysfs_emit(buf, "%d.%03d KHz\n", osc / 1000, osc % 1000);
}
static DEVICE_ATTR(osc, S_IRUGO, rs5c372_sysfs_show_osc, NULL);

--
2.56.0