diff options
| author | ye xingchen <ye.xingchen@zte.com.cn> | 2023-12-12 21:53:40 -0800 |
|---|---|---|
| committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2023-12-13 21:26:11 -0800 |
| commit | e50389f208daf1d60810e789b8860063e3256693 (patch) | |
| tree | b0dc8c053542e51c53f34c4289375ac207ff88be /drivers/input/touchscreen/hideep.c | |
| parent | 1864a2006ee1e41960b63ca63aa79fabb690e71b (diff) | |
| download | linux-e50389f208daf1d60810e789b8860063e3256693.tar.gz linux-e50389f208daf1d60810e789b8860063e3256693.tar.bz2 linux-e50389f208daf1d60810e789b8860063e3256693.zip | |
Input: touchscreen - use sysfs_emit[_at]() instead of scnprintf()
Follow the advice of the Documentation/filesystems/sysfs.rst and show()
should only use sysfs_emit() or sysfs_emit_at() when formatting the
value to be returned to user space.
Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Oliver Graute <oliver.graute@kococonnector.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/touchscreen/hideep.c')
| -rw-r--r-- | drivers/input/touchscreen/hideep.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/input/touchscreen/hideep.c b/drivers/input/touchscreen/hideep.c index 0f58258306bf..eae90676f4e5 100644 --- a/drivers/input/touchscreen/hideep.c +++ b/drivers/input/touchscreen/hideep.c @@ -928,8 +928,7 @@ static ssize_t hideep_fw_version_show(struct device *dev, ssize_t len; mutex_lock(&ts->dev_mutex); - len = scnprintf(buf, PAGE_SIZE, "%04x\n", - be16_to_cpu(ts->dwz_info.release_ver)); + len = sysfs_emit(buf, "%04x\n", be16_to_cpu(ts->dwz_info.release_ver)); mutex_unlock(&ts->dev_mutex); return len; @@ -943,8 +942,7 @@ static ssize_t hideep_product_id_show(struct device *dev, ssize_t len; mutex_lock(&ts->dev_mutex); - len = scnprintf(buf, PAGE_SIZE, "%04x\n", - be16_to_cpu(ts->dwz_info.product_id)); + len = sysfs_emit(buf, "%04x\n", be16_to_cpu(ts->dwz_info.product_id)); mutex_unlock(&ts->dev_mutex); return len; |
