mirror of
https://github.com/torvalds/linux.git
synced 2026-05-31 18:43:33 +02:00
platform/chrome: wilco_ec: use sysfs_emit() instead of sprintf()
Follow the advice in Documentation/filesystems/sysfs.rst: show() should only use sysfs_emit() or sysfs_emit_at() when formatting the value to be returned to user space. Signed-off-by: Ai Chao <aichao@kylinos.cn> Link: https://lore.kernel.org/r/20240314052828.186924-1-aichao@kylinos.cn Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
This commit is contained in:
parent
0bbac3facb
commit
48e49af710
|
|
@ -192,7 +192,7 @@ static ssize_t usb_charge_show(struct device *dev,
|
|||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
return sprintf(buf, "%d\n", rs.val);
|
||||
return sysfs_emit(buf, "%d\n", rs.val);
|
||||
}
|
||||
|
||||
static ssize_t usb_charge_store(struct device *dev,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user