mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 20:51:03 +02:00
mfd: Use sysfs_emit() to 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> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/202212021528368292334@zte.com.cn
This commit is contained in:
@@ -349,7 +349,7 @@ static ssize_t pld_version_show(struct device *dev,
|
|||||||
{
|
{
|
||||||
struct kempld_device_data *pld = dev_get_drvdata(dev);
|
struct kempld_device_data *pld = dev_get_drvdata(dev);
|
||||||
|
|
||||||
return scnprintf(buf, PAGE_SIZE, "%s\n", pld->info.version);
|
return sysfs_emit(buf, "%s\n", pld->info.version);
|
||||||
}
|
}
|
||||||
|
|
||||||
static ssize_t pld_specification_show(struct device *dev,
|
static ssize_t pld_specification_show(struct device *dev,
|
||||||
@@ -357,8 +357,7 @@ static ssize_t pld_specification_show(struct device *dev,
|
|||||||
{
|
{
|
||||||
struct kempld_device_data *pld = dev_get_drvdata(dev);
|
struct kempld_device_data *pld = dev_get_drvdata(dev);
|
||||||
|
|
||||||
return scnprintf(buf, PAGE_SIZE, "%d.%d\n", pld->info.spec_major,
|
return sysfs_emit(buf, "%d.%d\n", pld->info.spec_major, pld->info.spec_minor);
|
||||||
pld->info.spec_minor);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static ssize_t pld_type_show(struct device *dev,
|
static ssize_t pld_type_show(struct device *dev,
|
||||||
@@ -366,7 +365,7 @@ static ssize_t pld_type_show(struct device *dev,
|
|||||||
{
|
{
|
||||||
struct kempld_device_data *pld = dev_get_drvdata(dev);
|
struct kempld_device_data *pld = dev_get_drvdata(dev);
|
||||||
|
|
||||||
return scnprintf(buf, PAGE_SIZE, "%s\n", kempld_get_type_string(pld));
|
return sysfs_emit(buf, "%s\n", kempld_get_type_string(pld));
|
||||||
}
|
}
|
||||||
|
|
||||||
static DEVICE_ATTR_RO(pld_version);
|
static DEVICE_ATTR_RO(pld_version);
|
||||||
|
@@ -286,7 +286,7 @@ static ssize_t show_output(struct device *dev,
|
|||||||
|
|
||||||
val = (val & mask) >> shift;
|
val = (val & mask) >> shift;
|
||||||
|
|
||||||
return scnprintf(buf, PAGE_SIZE, "%u\n", val);
|
return sysfs_emit(buf, "%u\n", val);
|
||||||
}
|
}
|
||||||
|
|
||||||
static ssize_t store_output(struct device *dev,
|
static ssize_t store_output(struct device *dev,
|
||||||
|
Reference in New Issue
Block a user