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 <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>
1 parent a5f65c7 commit 08c367e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

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)