auxdisplay: img-ascii-lcd: Convert device attribute to sysfs_emit()
authorGeert Uytterhoeven <geert@linux-m68k.org>
Tue, 19 Oct 2021 14:45:04 +0000 (16:45 +0200)
committerMiguel Ojeda <ojeda@kernel.org>
Thu, 21 Oct 2021 21:36:28 +0000 (23:36 +0200)
Convert the "message" device attribute from sprintf() to sysfs_emit(),
as the latter is aware of the PAGE_SIZE buffer.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
drivers/auxdisplay/img-ascii-lcd.c

index 2b6e41ec57544faa325769297219b916ea6cbe36..2b5640b638900a907b642c5dc6ac386c003f3399 100644 (file)
@@ -326,7 +326,7 @@ static ssize_t message_show(struct device *dev, struct device_attribute *attr,
 {
        struct img_ascii_lcd_ctx *ctx = dev_get_drvdata(dev);
 
-       return sprintf(buf, "%s\n", ctx->message);
+       return sysfs_emit(buf, "%s\n", ctx->message);
 }
 
 /**