Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

nvmem: Use sysfs_emit() for type attribute

Use sysfs_emit() instead of sprintf() to follow best practice per
Documentation/filesystems/sysfs.rst
"
show() should only use sysfs_emit()...
"

Signed-off-by: Marek Vasut <marex@denx.de>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20240705074852.423202-15-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Marek Vasut and committed by
Greg Kroah-Hartman
08c367e4 a5f65c77

+1 -1
+1 -1
drivers/nvmem/core.c
··· 179 179 { 180 180 struct nvmem_device *nvmem = to_nvmem_device(dev); 181 181 182 - return sprintf(buf, "%s\n", nvmem_type_str[nvmem->type]); 182 + return sysfs_emit(buf, "%s\n", nvmem_type_str[nvmem->type]); 183 183 } 184 184 185 185 static DEVICE_ATTR_RO(type);