mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
rtc: x1205: use sysfs_emit() instead of sprintf()
Use sysfs_emit() instead of sprintf() in sysfs show callbacks (x1205_sysfs_show_atrim and x1205_sysfs_show_dtrim) to conform to the recommended sysfs attribute formatting guidelines in Documentation/filesystems/sysfs.rst. Link: https://patch.msgid.link/20261029132339.925021-5-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
This commit is contained in:
parent
187c4ed20a
commit
0f3bc1c937
|
|
@ -575,7 +575,7 @@ static ssize_t x1205_sysfs_show_atrim(struct device *dev,
|
|||
if (err)
|
||||
return err;
|
||||
|
||||
return sprintf(buf, "%d.%02d pF\n", atrim / 1000, atrim % 1000);
|
||||
return sysfs_emit(buf, "%d.%02d pF\n", atrim / 1000, atrim % 1000);
|
||||
}
|
||||
static DEVICE_ATTR(atrim, S_IRUGO, x1205_sysfs_show_atrim, NULL);
|
||||
|
||||
|
|
@ -588,7 +588,7 @@ static ssize_t x1205_sysfs_show_dtrim(struct device *dev,
|
|||
if (err)
|
||||
return err;
|
||||
|
||||
return sprintf(buf, "%d ppm\n", dtrim);
|
||||
return sysfs_emit(buf, "%d ppm\n", dtrim);
|
||||
}
|
||||
static DEVICE_ATTR(dtrim, S_IRUGO, x1205_sysfs_show_dtrim, NULL);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user