Commit 51c6d61a authored by Sasha Levin's avatar Sasha Levin Committed by Rusty Russell

virtio-console: Use virtio_config_val() for retrieving config

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: default avatarSasha Levin <levinsasha928@gmail.com>
Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
parent b4beb4bf
...@@ -1675,13 +1675,11 @@ static int __devinit virtcons_probe(struct virtio_device *vdev) ...@@ -1675,13 +1675,11 @@ static int __devinit virtcons_probe(struct virtio_device *vdev)
multiport = false; multiport = false;
portdev->config.max_nr_ports = 1; portdev->config.max_nr_ports = 1;
if (virtio_has_feature(vdev, VIRTIO_CONSOLE_F_MULTIPORT)) { if (virtio_config_val(vdev, VIRTIO_CONSOLE_F_MULTIPORT,
multiport = true; offsetof(struct virtio_console_config,
vdev->config->get(vdev, offsetof(struct virtio_console_config,
max_nr_ports), max_nr_ports),
&portdev->config.max_nr_ports, &portdev->config.max_nr_ports) == 0)
sizeof(portdev->config.max_nr_ports)); multiport = true;
}
err = init_vqs(portdev); err = init_vqs(portdev);
if (err < 0) { if (err < 0) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment