All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] virtio-console: Use virtio_config_val() for retrieving config
@ 2011-08-14 14:52 Sasha Levin
  2011-08-14 14:52 ` [PATCH 2/3] virtio_config: Add virtio_config_val_len() Sasha Levin
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Sasha Levin @ 2011-08-14 14:52 UTC (permalink / raw)
  To: linux-kernel
  Cc: Sasha Levin, Amit Shah, Michael S. Tsirkin, Rusty Russell,
	virtualization

This patch modifies virtio-console to use virtio_config_val() instead
of a 'if(virtio_has_feature()) vdev->config->get()' construct to retrieve
optional values from the config space.

Cc: Amit Shah <amit.shah@redhat.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: virtualization@lists.linux-foundation.org
Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
---
 drivers/char/virtio_console.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c
index fb68b12..ed99f3b 100644
--- a/drivers/char/virtio_console.c
+++ b/drivers/char/virtio_console.c
@@ -1675,13 +1675,11 @@ static int __devinit virtcons_probe(struct virtio_device *vdev)
 
 	multiport = false;
 	portdev->config.max_nr_ports = 1;
-	if (virtio_has_feature(vdev, VIRTIO_CONSOLE_F_MULTIPORT)) {
+	if (virtio_config_val(vdev, VIRTIO_CONSOLE_F_MULTIPORT,
+			      offsetof(struct virtio_console_config,
+				       max_nr_ports),
+			      &portdev->config.max_nr_ports) == 0)
 		multiport = true;
-		vdev->config->get(vdev, offsetof(struct virtio_console_config,
-						 max_nr_ports),
-				  &portdev->config.max_nr_ports,
-				  sizeof(portdev->config.max_nr_ports));
-	}
 
 	err = init_vqs(portdev);
 	if (err < 0) {
-- 
1.7.6


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-08-15  1:01 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-14 14:52 [PATCH 1/3] virtio-console: Use virtio_config_val() for retrieving config Sasha Levin
2011-08-14 14:52 ` [PATCH 2/3] virtio_config: Add virtio_config_val_len() Sasha Levin
2011-08-14 14:52 ` Sasha Levin
2011-08-14 14:52 ` [PATCH 3/3] virtio-net: Use virtio_config_val() for retrieving config Sasha Levin
2011-08-15  0:58   ` Rusty Russell
2011-08-15  0:58   ` Rusty Russell
2011-08-14 14:52 ` Sasha Levin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.