Skip to content

Commit 08c367e

Browse files
Marek Vasutgregkh
authored andcommitted
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 <[email protected]> Signed-off-by: Srinivas Kandagatla <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent a5f65c7 commit 08c367e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/nvmem/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ static ssize_t type_show(struct device *dev,
179179
{
180180
struct nvmem_device *nvmem = to_nvmem_device(dev);
181181

182-
return sprintf(buf, "%s\n", nvmem_type_str[nvmem->type]);
182+
return sysfs_emit(buf, "%s\n", nvmem_type_str[nvmem->type]);
183183
}
184184

185185
static DEVICE_ATTR_RO(type);

0 commit comments

Comments
 (0)