Skip to content

Commit fda8c90

Browse files
andy-shevgregkh
authored andcommitted
docs: filesystems: sysfs: Make text and code for ->show() consistent
The documentation says that ->show() should only use sysfs_emit() or sysfs_emit_at(), but example keeps outdated code. Update the code to be consistent. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20220928135741.54919-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 1da40c2 commit fda8c90

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Documentation/filesystems/sysfs.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ A very simple (and naive) implementation of a device attribute is::
263263
static ssize_t show_name(struct device *dev, struct device_attribute *attr,
264264
char *buf)
265265
{
266-
return scnprintf(buf, PAGE_SIZE, "%s\n", dev->name);
266+
return sysfs_emit(buf, "%s\n", dev->name);
267267
}
268268

269269
static ssize_t store_name(struct device *dev, struct device_attribute *attr,

0 commit comments

Comments
 (0)