summaryrefslogtreecommitdiff
path: root/drivers/hwmon/ds1621.c
diff options
context:
space:
mode:
authorye xingchen <ye.xingchen@zte.com.cn>2022-12-01 11:30:31 +0800
committerGuenter Roeck <linux@roeck-us.net>2022-12-04 16:49:43 -0800
commit4e6104b1e70020ad500f0fab7238898dd2ea2a38 (patch)
tree00d9afe0a01e43f3794ac603c63ae46faa95348b /drivers/hwmon/ds1621.c
parent0cd3ba682ae27cbe17c41f85b8e6db6da38296b2 (diff)
hwmon: use sysfs_emit() to instead of scnprintf()
Replace the open-code with sysfs_emit() to simplify the code. Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn> Link: https://lore.kernel.org/r/202212011130317080061@zte.com.cn Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon/ds1621.c')
-rw-r--r--drivers/hwmon/ds1621.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hwmon/ds1621.c b/drivers/hwmon/ds1621.c
index 0886abf6ebab..e803d6393b9e 100644
--- a/drivers/hwmon/ds1621.c
+++ b/drivers/hwmon/ds1621.c
@@ -269,7 +269,7 @@ static ssize_t update_interval_show(struct device *dev,
struct device_attribute *da, char *buf)
{
struct ds1621_data *data = dev_get_drvdata(dev);
- return scnprintf(buf, PAGE_SIZE, "%hu\n", data->update_interval);
+ return sysfs_emit(buf, "%hu\n", data->update_interval);
}
static ssize_t update_interval_store(struct device *dev,