Skip to content

Commit 1deceab

Browse files
geertubroonie
authored andcommitted
regulator: bd9571mwv: Convert device attribute to sysfs_emit()
Convert the "backup_mode" device attribute from sprintf() to sysfs_emit(), as the latter is aware of the PAGE_SIZE buffer. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://lore.kernel.org/r/20210312130242.3390038-4-geert+renesas@glider.be Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 9cbc23f commit 1deceab

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/regulator/bd9571mwv-regulator.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ static ssize_t backup_mode_show(struct device *dev,
174174
{
175175
struct bd9571mwv_reg *bdreg = dev_get_drvdata(dev);
176176

177-
return sprintf(buf, "%s\n", bdreg->bkup_mode_enabled ? "on" : "off");
177+
return sysfs_emit(buf, "%s\n", bdreg->bkup_mode_enabled ? "on" : "off");
178178
}
179179

180180
static ssize_t backup_mode_store(struct device *dev,

0 commit comments

Comments
 (0)