diff options
author | Ai Chao <aichao@kylinos.cn> | 2024-03-14 06:28:28 +0100 |
---|---|---|
committer | Tzung-Bi Shih <tzungbi@kernel.org> | 2024-04-24 10:45:56 +0200 |
commit | 48e49af7108b6e0d014a08650c41470f812e44bc (patch) | |
tree | 76ed09c62b96d63d02e838610d2e3d90c686024c /drivers/platform/chrome | |
parent | Linux 6.9-rc4 (diff) | |
download | linux-48e49af7108b6e0d014a08650c41470f812e44bc.tar.xz linux-48e49af7108b6e0d014a08650c41470f812e44bc.zip |
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>
Diffstat (limited to 'drivers/platform/chrome')
-rw-r--r-- | drivers/platform/chrome/wilco_ec/sysfs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/platform/chrome/wilco_ec/sysfs.c b/drivers/platform/chrome/wilco_ec/sysfs.c index 893c59dde32a..d44c43559621 100644 --- a/drivers/platform/chrome/wilco_ec/sysfs.c +++ b/drivers/platform/chrome/wilco_ec/sysfs.c @@ -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, |