summaryrefslogtreecommitdiffstats
path: root/drivers/nvmem
diff options
context:
space:
mode:
authorMarek Vasut <marex@denx.de>2024-07-05 09:48:51 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-07-05 09:55:05 +0200
commit08c367e45b6d322956878774f0b88bf5e52c6d54 (patch)
treec75fef580a69325e03e22a21825d498f8e56db1e /drivers/nvmem
parentnvmem: Document type attribute (diff)
downloadlinux-08c367e45b6d322956878774f0b88bf5e52c6d54.tar.xz
linux-08c367e45b6d322956878774f0b88bf5e52c6d54.zip
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>
Diffstat (limited to 'drivers/nvmem')
-rw-r--r--drivers/nvmem/core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c
index ec31c1fe9a99..89f632f91768 100644
--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -179,7 +179,7 @@ static ssize_t type_show(struct device *dev,
{
struct nvmem_device *nvmem = to_nvmem_device(dev);
- return sprintf(buf, "%s\n", nvmem_type_str[nvmem->type]);
+ return sysfs_emit(buf, "%s\n", nvmem_type_str[nvmem->type]);
}
static DEVICE_ATTR_RO(type);