diff options
author | Sasha Levin <levinsasha928@gmail.com> | 2011-08-14 10:52:31 -0400 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2011-11-01 21:10:58 -0400 |
commit | 51c6d61ac58844b5e3e0d28271084c06f6a15371 (patch) | |
tree | d98c755facff356cfcf1205c5e5315f23379c58e /drivers/char | |
parent | b4beb4bf9934d151bf4581a54ae028927374cb2a (diff) |
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: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'drivers/char')
-rw-r--r-- | 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 fb68b1295373..ed99f3bf341a 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) | |||
1675 | 1675 | ||
1676 | multiport = false; | 1676 | multiport = false; |
1677 | portdev->config.max_nr_ports = 1; | 1677 | portdev->config.max_nr_ports = 1; |
1678 | if (virtio_has_feature(vdev, VIRTIO_CONSOLE_F_MULTIPORT)) { | 1678 | if (virtio_config_val(vdev, VIRTIO_CONSOLE_F_MULTIPORT, |
1679 | offsetof(struct virtio_console_config, | ||
1680 | max_nr_ports), | ||
1681 | &portdev->config.max_nr_ports) == 0) | ||
1679 | multiport = true; | 1682 | multiport = true; |
1680 | vdev->config->get(vdev, offsetof(struct virtio_console_config, | ||
1681 | max_nr_ports), | ||
1682 | &portdev->config.max_nr_ports, | ||
1683 | sizeof(portdev->config.max_nr_ports)); | ||
1684 | } | ||
1685 | 1683 | ||
1686 | err = init_vqs(portdev); | 1684 | err = init_vqs(portdev); |
1687 | if (err < 0) { | 1685 | if (err < 0) { |