virtio: console: We support only one device at a time
authorAmit Shah <amit.shah@redhat.com>
Mon, 18 Jan 2010 13:44:59 +0000 (19:14 +0530)
committerRusty Russell <rusty@rustcorp.com.au>
Wed, 24 Feb 2010 03:52:33 +0000 (14:22 +1030)
We support only one virtio_console device at a time. If multiple are
found, error out if one is already initialized.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
drivers/char/virtio_console.c

index 791be4e91d15dad783cc45c153dd43ed8d275743..bfc0abf825ed5bdf2cedd4b1de4258614a5cea49 100644 (file)
@@ -204,6 +204,11 @@ static int __devinit virtcons_probe(struct virtio_device *dev)
        struct virtqueue *vqs[2];
        int err;
 
+       if (vdev) {
+               dev_warn(&vdev->dev,
+                        "Multiple virtio-console devices not supported yet\n");
+               return -EEXIST;
+       }
        vdev = dev;
 
        /* This is the scratch page we use to receive console input */