Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753338AbbBFFM7 (ORCPT ); Fri, 6 Feb 2015 00:12:59 -0500 Received: from ozlabs.org ([103.22.144.67]:53080 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750988AbbBFFMA (ORCPT ); Fri, 6 Feb 2015 00:12:00 -0500 From: Rusty Russell To: "lkml" Cc: "Michael S. Tsirkin" , Amit Shah Subject: [PATCH 5/5] virtio: don't require a config space on the console device. Date: Fri, 6 Feb 2015 15:36:56 +1030 Message-Id: <1423199216-2094-6-git-send-email-rusty@rustcorp.com.au> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1423199216-2094-1-git-send-email-rusty@rustcorp.com.au> References: <1423199216-2094-1-git-send-email-rusty@rustcorp.com.au> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1295 Lines: 38 Strictly, it's only needed when we have features (size or multiport). Signed-off-by: Rusty Russell --- drivers/char/virtio_console.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index 26afb56a8073..8f182b0015b5 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c @@ -1986,10 +1986,14 @@ static int virtcons_probe(struct virtio_device *vdev) bool multiport; bool early = early_put_chars != NULL; - if (!vdev->config->get) { - dev_err(&vdev->dev, "%s failure: config access disabled\n", - __func__); - return -EINVAL; + /* We only need a config space if features are offered */ + if (virtio_has_feature(vdev, VIRTIO_CONSOLE_F_SIZE) + || virtio_has_feature(vdev, VIRTIO_CONSOLE_F_MULTIPORT)) { + if (!vdev->config->get) { + dev_err(&vdev->dev, "%s failure: config access disabled\n", + __func__); + return -EINVAL; + } } /* Ensure to read early_put_chars now */ -- 2.1.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/