diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2023-07-03 20:52:20 +0200 |
---|---|---|
committer | Benjamin Tissoires <bentiss@kernel.org> | 2023-07-28 17:05:48 +0200 |
commit | 5120bf04984a73c7fdae23bcfef8b1f45774e05b (patch) | |
tree | b323b125f8ec5632654bc6d783adc5e20f6ba0dc | |
parent | HID: cp2112: Use BIT() in GPIO setter and getter (diff) | |
download | linux-5120bf04984a73c7fdae23bcfef8b1f45774e05b.tar.xz linux-5120bf04984a73c7fdae23bcfef8b1f45774e05b.zip |
HID: cp2112: Use sysfs_emit() to instead of scnprintf()
Follow the advice of the Documentation/filesystems/sysfs.rst and show()
should only use sysfs_emit() or sysfs_emit_at() when formatting the
value to be returned to user space.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20230703185222.50554-11-andriy.shevchenko@linux.intel.com
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
-rw-r--r-- | drivers/hid/hid-cp2112.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hid/hid-cp2112.c b/drivers/hid/hid-cp2112.c index 2eebb2b19501..1e45f5407d09 100644 --- a/drivers/hid/hid-cp2112.c +++ b/drivers/hid/hid-cp2112.c @@ -893,7 +893,7 @@ static ssize_t name##_show(struct device *kdev, \ int ret = cp2112_get_usb_config(hdev, &cfg); \ if (ret) \ return ret; \ - return scnprintf(buf, PAGE_SIZE, format, ##__VA_ARGS__); \ + return sysfs_emit(buf, format, ##__VA_ARGS__); \ } \ static DEVICE_ATTR_RW(name); |