rtc: ds1343: use sysfs_emit() instead of sprintf() Use sysfs_emit() instead of sprintf() in sysfs show callbacks (ds1343_show_glitchfilter and ds1343_show_tricklecharger) to conform to the recommended sysfs attribute formatting guidelines in Documentation/filesystems/sysfs.rst. Link: https://patch.msgid.link/20261029132339.925021-8-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
diff --git a/drivers/rtc/rtc-ds1343.c b/drivers/rtc/rtc-ds1343.c index 22abec4..0ec5eab 100644 --- a/drivers/rtc/rtc-ds1343.c +++ b/drivers/rtc/rtc-ds1343.c
@@ -94,9 +94,9 @@ static ssize_t ds1343_show_glitchfilter(struct device *dev, glitch_filt_status = !!(data & DS1343_EGFIL); if (glitch_filt_status) - return sprintf(buf, "enabled\n"); + return sysfs_emit(buf, "enabled\n"); else - return sprintf(buf, "disabled\n"); + return sysfs_emit(buf, "disabled\n"); } static ssize_t ds1343_store_glitchfilter(struct device *dev, @@ -180,7 +180,7 @@ static ssize_t ds1343_show_tricklecharger(struct device *dev, } } - return sprintf(buf, "%s %s\n", diodes, resistors); + return sysfs_emit(buf, "%s %s\n", diodes, resistors); } static DEVICE_ATTR(trickle_charger, 0444, ds1343_show_tricklecharger, NULL);