From: Marek Vasut Date: Fri, 5 Jul 2024 07:48:51 +0000 (+0100) Subject: nvmem: Use sysfs_emit() for type attribute X-Git-Tag: io_uring-6.11-20240722~8^2~21 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=08c367e45b6d322956878774f0b88bf5e52c6d54;p=linux-block.git 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 Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20240705074852.423202-15-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman --- 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);