diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2023-01-20 17:44:33 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-01-24 18:12:58 +0100 |
commit | 861fa1c3fafffe47e6845ce95c847b2422792fcc (patch) | |
tree | 295c925f0c6bb5a12356b78f8088d636ab3f8d19 /drivers/usb/fotg210 | |
parent | c5d4297f0c20dd8650019786ab7e94296e6b8647 (diff) | |
download | linux-861fa1c3fafffe47e6845ce95c847b2422792fcc.tar.gz linux-861fa1c3fafffe47e6845ce95c847b2422792fcc.tar.bz2 linux-861fa1c3fafffe47e6845ce95c847b2422792fcc.zip |
usb: fotg210-hcd: 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/20230120154437.22025-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/fotg210')
-rw-r--r-- | drivers/usb/fotg210/fotg210-hcd.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/usb/fotg210/fotg210-hcd.c b/drivers/usb/fotg210/fotg210-hcd.c index 7bd1e8f3080d..46752a75c428 100644 --- a/drivers/usb/fotg210/fotg210-hcd.c +++ b/drivers/usb/fotg210/fotg210-hcd.c @@ -4686,14 +4686,11 @@ static ssize_t uframe_periodic_max_show(struct device *dev, struct device_attribute *attr, char *buf) { struct fotg210_hcd *fotg210; - int n; fotg210 = hcd_to_fotg210(bus_to_hcd(dev_get_drvdata(dev))); - n = scnprintf(buf, PAGE_SIZE, "%d\n", fotg210->uframe_periodic_max); - return n; + return sysfs_emit(buf, "%d\n", fotg210->uframe_periodic_max); } - static ssize_t uframe_periodic_max_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { |