platform/x86: dell-smbios-base: Use sysfs_emit()

[ Upstream commit bbfa903b4f ]

Replace the open-code with sysfs_emit() to simplify the code.

Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
Link: https://lore.kernel.org/r/20220923063233.239091-1-ye.xingchen@zte.com.cn
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Stable-dep-of: 1981b296f8 ("platform/x86: dell-smbios: Fix wrong token data in sysfs")
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
ye xingchen
2022-09-23 06:32:33 +00:00
committed by Greg Kroah-Hartman
parent 9e6c4b1027
commit beec9b57e9
+2 -2
View File
@@ -441,7 +441,7 @@ static ssize_t location_show(struct device *dev,
i = match_attribute(dev, attr);
if (i > 0)
return scnprintf(buf, PAGE_SIZE, "%08x", da_tokens[i].location);
return sysfs_emit(buf, "%08x", da_tokens[i].location);
return 0;
}
@@ -455,7 +455,7 @@ static ssize_t value_show(struct device *dev,
i = match_attribute(dev, attr);
if (i > 0)
return scnprintf(buf, PAGE_SIZE, "%08x", da_tokens[i].value);
return sysfs_emit(buf, "%08x", da_tokens[i].value);
return 0;
}