aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryunshui <[email protected]>2024-04-17 17:20:55 +0800
committerHans de Goede <[email protected]>2024-04-29 10:52:03 +0200
commit95cd8806fbb9d3f7acf9eb206f98adbaedc3adb4 (patch)
treeb892bbdf41a307dd5323cbf897aa3aa0b8ed307b
parentf1f663ebfbec349118c41a5563aa266953200058 (diff)
platform/x86: thinkpad_acpi: change sprintf() to sysfs_emit()
As Documentation/filesystems/sysfs.rst suggested, show() should only use sysfs_emit() or sysfs_emit_at() when formatting the value to be returned to user space. Signed-off-by: yunshui <[email protected]> Reviewed-by: Ai Chao <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Hans de Goede <[email protected]>
-rw-r--r--drivers/platform/x86/thinkpad_acpi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index 771aaa7ae4cf..729ab2de30b5 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -2679,7 +2679,7 @@ static ssize_t hotkey_bios_enabled_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{
- return sprintf(buf, "0\n");
+ return sysfs_emit(buf, "0\n");
}
static DEVICE_ATTR_RO(hotkey_bios_enabled);
@@ -9789,7 +9789,7 @@ static ssize_t tpacpi_battery_show(int what,
battery = BAT_PRIMARY;
if (tpacpi_battery_get(what, battery, &ret))
return -ENODEV;
- return sprintf(buf, "%d\n", ret);
+ return sysfs_emit(buf, "%d\n", ret);
}
static ssize_t charge_control_start_threshold_show(struct device *device,