summaryrefslogtreecommitdiff
path: root/drivers/hid/hid-sensor-custom.c
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.com>2024-05-14 14:50:43 +0300
committerJiri Kosina <jkosina@suse.com>2024-05-14 14:50:43 +0300
commit88a8049f8df815c155eb370048e7dc9bf1c75bf0 (patch)
treed8721873b80b4e70320a589fb05fe7d42c899823 /drivers/hid/hid-sensor-custom.c
parent5a95cc9c156bb4178c265f4c83cb96634d79bcdb (diff)
parent209eb1f30e9bb305c92f0a53ce6f6ddf5a9f4060 (diff)
downloadlinux-88a8049f8df815c155eb370048e7dc9bf1c75bf0.tar.xz
Merge branch 'for-6.10/hid-sysfs-emit' into for-linus
- conversion from sprintf() to sysfs_emit() (Li Zhijian)
Diffstat (limited to 'drivers/hid/hid-sensor-custom.c')
-rw-r--r--drivers/hid/hid-sensor-custom.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/hid/hid-sensor-custom.c b/drivers/hid/hid-sensor-custom.c
index d85398721659..ac214777d7d9 100644
--- a/drivers/hid/hid-sensor-custom.c
+++ b/drivers/hid/hid-sensor-custom.c
@@ -155,7 +155,7 @@ static ssize_t enable_sensor_show(struct device *dev,
{
struct hid_sensor_custom *sensor_inst = dev_get_drvdata(dev);
- return sprintf(buf, "%d\n", sensor_inst->enable);
+ return sysfs_emit(buf, "%d\n", sensor_inst->enable);
}
static int set_power_report_state(struct hid_sensor_custom *sensor_inst,
@@ -372,14 +372,13 @@ static ssize_t show_value(struct device *dev, struct device_attribute *attr,
sizeof(struct hid_custom_usage_desc),
usage_id_cmp);
if (usage_desc)
- return snprintf(buf, PAGE_SIZE, "%s\n",
- usage_desc->desc);
+ return sysfs_emit(buf, "%s\n", usage_desc->desc);
else
- return sprintf(buf, "not-specified\n");
+ return sysfs_emit(buf, "not-specified\n");
} else
return -EINVAL;
- return sprintf(buf, "%d\n", value);
+ return sysfs_emit(buf, "%d\n", value);
}
static ssize_t store_value(struct device *dev, struct device_attribute *attr,