Skip to content

Commit 87bb477

Browse files
Jiri Pirkomstsirkin
authored andcommitted
caif_virtio: use virtio_find_single_vq() for single virtqueue finding
Since caif uses only one queue, convert to virtio_find_single_vq() helper which is made for this purpose. Signed-off-by: Jiri Pirko <[email protected]> Message-Id: <[email protected]> Signed-off-by: Michael S. Tsirkin <[email protected]>
1 parent 8e0751a commit 87bb477

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/net/caif/caif_virtio.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -646,9 +646,7 @@ static inline void debugfs_init(struct cfv_info *cfv)
646646
/* Setup CAIF for the a virtio device */
647647
static int cfv_probe(struct virtio_device *vdev)
648648
{
649-
vq_callback_t *vq_cbs = cfv_release_cb;
650649
vrh_callback_t *vrh_cbs = cfv_recv;
651-
const char *names = "output";
652650
const char *cfv_netdev_name = "cfvrt";
653651
struct net_device *netdev;
654652
struct cfv_info *cfv;
@@ -675,9 +673,11 @@ static int cfv_probe(struct virtio_device *vdev)
675673
goto err;
676674

677675
/* Get the TX virtio ring. This is a "guest side vring". */
678-
err = virtio_find_vqs(vdev, 1, &cfv->vq_tx, &vq_cbs, &names, NULL);
679-
if (err)
676+
cfv->vq_tx = virtio_find_single_vq(vdev, cfv_release_cb, "output");
677+
if (IS_ERR(cfv->vq_tx)) {
678+
err = PTR_ERR(cfv->vq_tx);
680679
goto err;
680+
}
681681

682682
/* Get the CAIF configuration from virtio config space, if available */
683683
if (vdev->config->get) {

0 commit comments

Comments
 (0)