diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2022-06-29 00:17:45 +0200 |
---|---|---|
committer | Lee Jones <lee@kernel.org> | 2022-07-19 11:54:42 +0200 |
commit | 86da8be35c00e01b8b277896d8e81fb33bf22d06 (patch) | |
tree | b4806a8da30a3a031bc788ac1c86ce99fe27e131 /drivers/mfd | |
parent | mfd: intel_soc_pmic_bxtwc: Use bits.h macros for all masks (diff) | |
download | linux-86da8be35c00e01b8b277896d8e81fb33bf22d06.tar.xz linux-86da8be35c00e01b8b277896d8e81fb33bf22d06.zip |
mfd: intel_soc_pmic_bxtwc: Use sysfs_emit() instead of sprintf()
sysfs_emit() is preferred over sprintf() when formatting the value to be
returned to user space in show() functions, because it knows about sysfs
buffer specifics and has sanity checks.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20220628221747.33956-9-andriy.shevchenko@linux.intel.com
Diffstat (limited to 'drivers/mfd')
-rw-r--r-- | drivers/mfd/intel_soc_pmic_bxtwc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/mfd/intel_soc_pmic_bxtwc.c b/drivers/mfd/intel_soc_pmic_bxtwc.c index 5ac623eda1c1..db7bda114d2d 100644 --- a/drivers/mfd/intel_soc_pmic_bxtwc.c +++ b/drivers/mfd/intel_soc_pmic_bxtwc.c @@ -334,7 +334,7 @@ static unsigned long bxtwc_reg_addr; static ssize_t addr_show(struct device *dev, struct device_attribute *attr, char *buf) { - return sprintf(buf, "0x%lx\n", bxtwc_reg_addr); + return sysfs_emit(buf, "0x%lx\n", bxtwc_reg_addr); } static ssize_t addr_store(struct device *dev, @@ -362,7 +362,7 @@ static ssize_t val_show(struct device *dev, return ret; } - return sprintf(buf, "0x%02x\n", val); + return sysfs_emit(buf, "0x%02x\n", val); } static ssize_t val_store(struct device *dev, |