virtio_rng: use simplified virtqueue accessors.
authorRusty Russell <rusty@rustcorp.com.au>
Wed, 20 Mar 2013 05:14:29 +0000 (15:44 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Wed, 20 Mar 2013 05:15:03 +0000 (15:45 +1030)
We never add buffers with input and output parts, so use the new accessors.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Reviewed-by: Asias He <asias@redhat.com>
drivers/char/hw_random/virtio-rng.c

index 10fd71ccf587789858582b09f37e646b7119e937..842e2d55d3353e8e98cd972d945b5a1ff1f6efe3 100644 (file)
@@ -47,7 +47,7 @@ static void register_buffer(u8 *buf, size_t size)
        sg_init_one(&sg, buf, size);
 
        /* There should always be room for one buffer. */
-       if (virtqueue_add_buf(vq, &sg, 0, 1, buf, GFP_KERNEL) < 0)
+       if (virtqueue_add_inbuf(vq, &sg, 1, buf, GFP_KERNEL) < 0)
                BUG();
 
        virtqueue_kick(vq);