mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
rtc: rv3029: use sysfs_emit() instead of sprintf()
Use sysfs_emit() instead of sprintf() in sysfs show callbacks (rv3029_hwmon_show_temp and rv3029_hwmon_show_update_interval) to conform to the recommended sysfs attribute formatting guidelines in Documentation/filesystems/sysfs.rst. Link: https://patch.msgid.link/20261029132339.925021-1-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
This commit is contained in:
parent
3b6cdc3655
commit
bc9a04e1e1
|
|
@ -601,7 +601,7 @@ static ssize_t rv3029_hwmon_show_temp(struct device *dev,
|
|||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
return sprintf(buf, "%d\n", temp_mC);
|
||||
return sysfs_emit(buf, "%d\n", temp_mC);
|
||||
}
|
||||
|
||||
static ssize_t rv3029_hwmon_set_update_interval(struct device *dev,
|
||||
|
|
@ -654,7 +654,7 @@ static ssize_t rv3029_hwmon_show_update_interval(struct device *dev,
|
|||
interval_ms = 0;
|
||||
}
|
||||
|
||||
return sprintf(buf, "%d\n", interval_ms);
|
||||
return sysfs_emit(buf, "%d\n", interval_ms);
|
||||
}
|
||||
|
||||
static SENSOR_DEVICE_ATTR(temp1_input, S_IRUGO, rv3029_hwmon_show_temp,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user