Skip to content

Commit cee51d6

Browse files
committed
virtio_rpmsg_bus: use simplified virtqueue accessors.
We never add buffers with input and output parts, so use the new accessors. Cc: Ohad Ben-Cohen <ohad@wizery.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
1 parent 71bcbec commit cee51d6

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎drivers/rpmsg/virtio_rpmsg_bus.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -757,14 +757,14 @@ int rpmsg_send_offchannel_raw(struct rpmsg_channel *rpdev, u32 src, u32 dst,
757757
mutex_lock(&vrp->tx_lock);
758758

759759
/* add message to the remote processor's virtqueue */
760-
err = virtqueue_add_buf(vrp->svq, &sg, 1, 0, msg, GFP_KERNEL);
760+
err = virtqueue_add_outbuf(vrp->svq, &sg, 1, msg, GFP_KERNEL);
761761
if (err) {
762762
/*
763763
* need to reclaim the buffer here, otherwise it's lost
764764
* (memory won't leak, but rpmsg won't use it again for TX).
765765
* this will wait for a buffer management overhaul.
766766
*/
767-
dev_err(dev, "virtqueue_add_buf failed: %d\n", err);
767+
dev_err(dev, "virtqueue_add_outbuf failed: %d\n", err);
768768
goto out;
769769
}
770770

@@ -839,7 +839,7 @@ static void rpmsg_recv_done(struct virtqueue *rvq)
839839
sg_init_one(&sg, msg, RPMSG_BUF_SIZE);
840840

841841
/* add the buffer back to the remote processor's virtqueue */
842-
err = virtqueue_add_buf(vrp->rvq, &sg, 0, 1, msg, GFP_KERNEL);
842+
err = virtqueue_add_inbuf(vrp->rvq, &sg, 1, msg, GFP_KERNEL);
843843
if (err < 0) {
844844
dev_err(dev, "failed to add a virtqueue buffer: %d\n", err);
845845
return;
@@ -970,7 +970,7 @@ static int rpmsg_probe(struct virtio_device *vdev)
970970

971971
sg_init_one(&sg, cpu_addr, RPMSG_BUF_SIZE);
972972

973-
err = virtqueue_add_buf(vrp->rvq, &sg, 0, 1, cpu_addr,
973+
err = virtqueue_add_inbuf(vrp->rvq, &sg, 1, cpu_addr,
974974
GFP_KERNEL);
975975
WARN_ON(err); /* sanity check; this can't really happen */
976976
}

0 commit comments

Comments
 (0)