hwmon: (max31827) use sysfs_emit() in temp1_resolution_show()
Replace scnprintf() with sysfs_emit() in temp1_resolution_show(), as recommended in Documentation/filesystems/sysfs.rst: show() callbacks should use sysfs_emit() or sysfs_emit_at() to format values returned to userspace. Signed-off-by: Khaled Elnaggar <khaledelnaggarlinux@gmail.com> Link: https://lore.kernel.org/r/20250712131447.326995-1-khaledelnaggarlinux@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
This commit is contained in:
committed by
Guenter Roeck
parent
9f4401ad37
commit
d1eb9fe14e
@@ -445,7 +445,7 @@ static ssize_t temp1_resolution_show(struct device *dev,
|
||||
|
||||
val = FIELD_GET(MAX31827_CONFIGURATION_RESOLUTION_MASK, val);
|
||||
|
||||
return scnprintf(buf, PAGE_SIZE, "%u\n", max31827_resolutions[val]);
|
||||
return sysfs_emit(buf, "%u\n", max31827_resolutions[val]);
|
||||
}
|
||||
|
||||
static ssize_t temp1_resolution_store(struct device *dev,
|
||||
|
||||
Reference in New Issue
Block a user