]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
virtio: console: Fix early_put_chars usage
authorFrançois Diakhaté <fdiakh@gmail.com>
Tue, 23 Mar 2010 12:53:15 +0000 (18:23 +0530)
committerRusty Russell <rusty@rustcorp.com.au>
Thu, 8 Apr 2010 00:16:15 +0000 (09:46 +0930)
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 <borntraeger@de.ibm.com>
Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
drivers/char/virtio_console.c

index 026ea6c27e07df30a9e777c0f43a70f3258af4b6..48306bc733f7d11f7d60c92dc633af95e236d60f 100644 (file)
@@ -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);
 }