mirror of
https://github.com/torvalds/linux.git
synced 2026-11-06 21:58:01 +01:00
rtc: rs5c372: use sysfs_emit() instead of sprintf()
Use sysfs_emit() instead of sprintf() in sysfs show callbacks (rs5c372_sysfs_show_trim and rs5c372_sysfs_show_osc) to conform to the recommended sysfs attribute formatting guidelines in Documentation/filesystems/sysfs.rst. Link: https://patch.msgid.link/20261029132339.925021-12-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
This commit is contained in:
parent
42602b8343
commit
7485659ecb
|
|
@ -699,7 +699,7 @@ static ssize_t rs5c372_sysfs_show_trim(struct device *dev,
|
|||
if (err)
|
||||
return err;
|
||||
|
||||
return sprintf(buf, "%d\n", trim);
|
||||
return sysfs_emit(buf, "%d\n", trim);
|
||||
}
|
||||
static DEVICE_ATTR(trim, S_IRUGO, rs5c372_sysfs_show_trim, NULL);
|
||||
|
||||
|
|
@ -712,7 +712,7 @@ static ssize_t rs5c372_sysfs_show_osc(struct device *dev,
|
|||
if (err)
|
||||
return err;
|
||||
|
||||
return sprintf(buf, "%d.%03d KHz\n", osc / 1000, osc % 1000);
|
||||
return sysfs_emit(buf, "%d.%03d KHz\n", osc / 1000, osc % 1000);
|
||||
}
|
||||
static DEVICE_ATTR(osc, S_IRUGO, rs5c372_sysfs_show_osc, NULL);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user