Commit 48e49af7 authored by Ai Chao's avatar Ai Chao Committed by Tzung-Bi Shih

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: default avatarAi Chao <aichao@kylinos.cn>
Link: https://lore.kernel.org/r/20240314052828.186924-1-aichao@kylinos.cnSigned-off-by: default avatarTzung-Bi Shih <tzungbi@kernel.org>
parent 0bbac3fa
......@@ -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,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment