aboutsummaryrefslogtreecommitdiffstats
path: root/net/9p/trans_virtio.c
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2013-10-14 03:41:51 -0400
committerRusty Russell <rusty@rustcorp.com.au>2013-10-16 20:25:37 -0400
commit855e0c5288177bcb193f6f6316952d2490478e1c (patch)
tree7c5cfed44c9def1a7ca3388f37a9520de52af44b /net/9p/trans_virtio.c
parent0b90d0622ad290b3717a13489b396af52aea9d2d (diff)
virtio: use size-based config accessors.
This lets the transport do endian conversion if necessary, and insulates the drivers from the difference. Most drivers can use the simple helpers virtio_cread() and virtio_cwrite(). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'net/9p/trans_virtio.c')
-rw-r--r--net/9p/trans_virtio.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c
index 990afab2be1b..9c5a1aa34d12 100644
--- a/net/9p/trans_virtio.c
+++ b/net/9p/trans_virtio.c
@@ -544,9 +544,7 @@ static int p9_virtio_probe(struct virtio_device *vdev)
544 544
545 chan->inuse = false; 545 chan->inuse = false;
546 if (virtio_has_feature(vdev, VIRTIO_9P_MOUNT_TAG)) { 546 if (virtio_has_feature(vdev, VIRTIO_9P_MOUNT_TAG)) {
547 vdev->config->get(vdev, 547 virtio_cread(vdev, struct virtio_9p_config, tag_len, &tag_len);
548 offsetof(struct virtio_9p_config, tag_len),
549 &tag_len, sizeof(tag_len));
550 } else { 548 } else {
551 err = -EINVAL; 549 err = -EINVAL;
552 goto out_free_vq; 550 goto out_free_vq;
@@ -556,8 +554,9 @@ static int p9_virtio_probe(struct virtio_device *vdev)
556 err = -ENOMEM; 554 err = -ENOMEM;
557 goto out_free_vq; 555 goto out_free_vq;
558 } 556 }
559 vdev->config->get(vdev, offsetof(struct virtio_9p_config, tag), 557
560 tag, tag_len); 558 virtio_cread_bytes(vdev, offsetof(struct virtio_9p_config, tag),
559 tag, tag_len);
561 chan->tag = tag; 560 chan->tag = tag;
562 chan->tag_len = tag_len; 561 chan->tag_len = tag_len;
563 err = sysfs_create_file(&(vdev->dev.kobj), &dev_attr_mount_tag.attr); 562 err = sysfs_create_file(&(vdev->dev.kobj), &dev_attr_mount_tag.attr);