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

From: alexandre . belloni

Date: Thu Oct 29 2026 - 09:39:24 EST


From: Alexandre Belloni <alexandre.belloni@xxxxxxxxxxx>

Use sysfs_emit() instead of sprintf() in the sysfs show callback
(bq32k_sysfs_show_tricklecharge_bypass) 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-bq32k.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/rtc/rtc-bq32k.c b/drivers/rtc/rtc-bq32k.c
index 573231613e52..0f50cfce88cb 100644
--- a/drivers/rtc/rtc-bq32k.c
+++ b/drivers/rtc/rtc-bq32k.c
@@ -210,7 +210,7 @@ static ssize_t bq32k_sysfs_show_tricklecharge_bypass(struct device *dev,
if (error)
return error;

- return sprintf(buf, "%d\n", (reg & BQ32K_TCFE) ? 1 : 0);
+ return sysfs_emit(buf, "%d\n", (reg & BQ32K_TCFE) ? 1 : 0);
}

static ssize_t bq32k_sysfs_store_tricklecharge_bypass(struct device *dev,
--
2.56.0