summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre Belloni <alexandre.belloni@bootlin.com>2026-10-29 14:23:31 +0100
committerAlexandre Belloni <alexandre.belloni@bootlin.com>2026-10-30 23:23:31 +0100
commit67b3eadfb80dee4dfd56ca624f33e2ac7ed5987a (patch)
treedafade2500542679b307e84135ab42e4743f273a
parentc0b38531ddc5e5a361d8e5e8315588e856bb2924 (diff)
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>
-rw-r--r--drivers/rtc/rtc-ds1343.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/rtc/rtc-ds1343.c b/drivers/rtc/rtc-ds1343.c
index 22abec4ba656..0ec5eaba6bd4 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);