mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
rtc: rv3028: use sysfs_emit() instead of sprintf()
Use sysfs_emit() instead of sprintf() in sysfs show callbacks (timestamp0_show and timestamp0_count_show) to conform to the recommended sysfs attribute formatting guidelines in Documentation/filesystems/sysfs.rst. Signed-off-by: Akshat Rawat <akshatrawat095@gmail.com> Link: https://patch.msgid.link/20261022081242.421-1-akshatrawat095@gmail.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
This commit is contained in:
parent
45efb584a1
commit
55bb587749
|
|
@ -147,8 +147,8 @@ static ssize_t timestamp0_show(struct device *dev,
|
|||
if (ret)
|
||||
return ret;
|
||||
|
||||
return sprintf(buf, "%llu\n",
|
||||
(unsigned long long)rtc_tm_to_time64(&tm));
|
||||
return sysfs_emit(buf, "%llu\n",
|
||||
(unsigned long long)rtc_tm_to_time64(&tm));
|
||||
};
|
||||
|
||||
static DEVICE_ATTR_RW(timestamp0);
|
||||
|
|
@ -164,7 +164,7 @@ static ssize_t timestamp0_count_show(struct device *dev,
|
|||
if (ret)
|
||||
return ret;
|
||||
|
||||
return sprintf(buf, "%u\n", count);
|
||||
return sysfs_emit(buf, "%u\n", count);
|
||||
};
|
||||
|
||||
static DEVICE_ATTR_RO(timestamp0_count);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user