Procházet zdrojové kódy

virtio: don't require a config space on the console device.

Strictly, it's only needed when we have features (size or multiport).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Rusty Russell před 10 roky
rodič
revize
be8ff5952a
1 změnil soubory, kde provedl 4 přidání a 1 odebrání
  1. 4 1
      drivers/char/virtio_console.c

+ 4 - 1
drivers/char/virtio_console.c

@@ -1986,7 +1986,10 @@ static int virtcons_probe(struct virtio_device *vdev)
 	bool multiport;
 	bool early = early_put_chars != NULL;
 
-	if (!vdev->config->get) {
+	/* We only need a config space if features are offered */
+	if (!vdev->config->get &&
+	    (virtio_has_feature(vdev, VIRTIO_CONSOLE_F_SIZE)
+	     || virtio_has_feature(vdev, VIRTIO_CONSOLE_F_MULTIPORT))) {
 		dev_err(&vdev->dev, "%s failure: config access disabled\n",
 			__func__);
 		return -EINVAL;