mirror of
https://github.com/torvalds/linux.git
synced 2026-11-06 21:58:01 +01:00
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>
This commit is contained in:
parent
c0b38531dd
commit
67b3eadfb8
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user