summaryrefslogtreecommitdiff
path: root/drivers/power/supply/bq24257_charger.c
diff options
context:
space:
mode:
authorye xingchen <ye.xingchen@zte.com.cn>2022-12-06 11:14:08 +0800
committerSebastian Reichel <sre@kernel.org>2023-01-02 08:54:07 +0100
commit35aa06286c0927a8444d851d6a1f2603e3dc9229 (patch)
treeb0b4edabc96d498a54d72badf0eda1bc6eb26055 /drivers/power/supply/bq24257_charger.c
parent1b929c02afd37871d5afb9d498426f83432e71c2 (diff)
downloadlwn-35aa06286c0927a8444d851d6a1f2603e3dc9229.tar.gz
lwn-35aa06286c0927a8444d851d6a1f2603e3dc9229.zip
power: supply: use sysfs_emit() instead of scnprintf() for sysfs show()
As documented in Documentation/filesystems/sysfs.rst the sysfs show() function should use sysfs_emit() or sysfs_emit_at() to format the userspace return value. This replaces all instances of scnprintf() with sysfs_emit() in the power-supply subsystem. Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn> [reword commit message] Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Diffstat (limited to 'drivers/power/supply/bq24257_charger.c')
-rw-r--r--drivers/power/supply/bq24257_charger.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/power/supply/bq24257_charger.c b/drivers/power/supply/bq24257_charger.c
index ab4c49788c58..103ddc2b3def 100644
--- a/drivers/power/supply/bq24257_charger.c
+++ b/drivers/power/supply/bq24257_charger.c
@@ -767,8 +767,7 @@ static ssize_t bq24257_show_ovp_voltage(struct device *dev,
struct power_supply *psy = dev_get_drvdata(dev);
struct bq24257_device *bq = power_supply_get_drvdata(psy);
- return scnprintf(buf, PAGE_SIZE, "%u\n",
- bq24257_vovp_map[bq->init_data.vovp]);
+ return sysfs_emit(buf, "%u\n", bq24257_vovp_map[bq->init_data.vovp]);
}
static ssize_t bq24257_show_in_dpm_voltage(struct device *dev,
@@ -778,8 +777,7 @@ static ssize_t bq24257_show_in_dpm_voltage(struct device *dev,
struct power_supply *psy = dev_get_drvdata(dev);
struct bq24257_device *bq = power_supply_get_drvdata(psy);
- return scnprintf(buf, PAGE_SIZE, "%u\n",
- bq24257_vindpm_map[bq->init_data.vindpm]);
+ return sysfs_emit(buf, "%u\n", bq24257_vindpm_map[bq->init_data.vindpm]);
}
static ssize_t bq24257_sysfs_show_enable(struct device *dev,
@@ -800,7 +798,7 @@ static ssize_t bq24257_sysfs_show_enable(struct device *dev,
if (ret < 0)
return ret;
- return scnprintf(buf, PAGE_SIZE, "%d\n", ret);
+ return sysfs_emit(buf, "%d\n", ret);
}
static ssize_t bq24257_sysfs_set_enable(struct device *dev,