From: François Diakhaté Date: Tue, 23 Mar 2010 12:53:15 +0000 (+0530) Subject: virtio: console: Fix early_put_chars usage X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=162a689a13ed61c0752726edb75427b2cd4186c1;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git virtio: console: Fix early_put_chars usage Currently early_put_chars is not used by virtio_console because it can only be used once a port has been found, at which point it's too late because it is no longer needed. This patch should fix it. Acked-by: Christian Borntraeger Signed-off-by: Amit Shah Signed-off-by: Rusty Russell --- diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index 026ea6c27e07..48306bc733f7 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c @@ -646,13 +646,13 @@ static int put_chars(u32 vtermno, const char *buf, int count) { struct port *port; + if (unlikely(early_put_chars)) + return early_put_chars(vtermno, buf, count); + port = find_port_by_vtermno(vtermno); if (!port) return 0; - if (unlikely(early_put_chars)) - return early_put_chars(vtermno, buf, count); - return send_buf(port, (void *)buf, count); }