Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9b2bbdb2 authored by Michael S. Tsirkin's avatar Michael S. Tsirkin
Browse files

virtio: wrap find_vqs



We are going to add more parameters to find_vqs, let's wrap the call so
we don't need to tweak all drivers every time.

Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
parent 4f6d9bfc
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -455,8 +455,7 @@ static int init_vq(struct virtio_blk *vblk)
	}

	/* Discover virtqueues and write information to configuration.  */
	err = vdev->config->find_vqs(vdev, num_vqs, vqs, callbacks, names,
			&desc);
	err = virtio_find_vqs(vdev, num_vqs, vqs, callbacks, names, &desc);
	if (err)
		goto out;

+3 −3
Original line number Diff line number Diff line
@@ -1945,7 +1945,7 @@ static int init_vqs(struct ports_device *portdev)
		}
	}
	/* Find the queues. */
	err = portdev->vdev->config->find_vqs(portdev->vdev, nr_queues, vqs,
	err = virtio_find_vqs(portdev->vdev, nr_queues, vqs,
			      io_callbacks,
			      (const char **)io_names, NULL);
	if (err)
+1 −2
Original line number Diff line number Diff line
@@ -119,8 +119,7 @@ static int virtcrypto_find_vqs(struct virtio_crypto *vi)
		names[i] = vi->data_vq[i].name;
	}

	ret = vi->vdev->config->find_vqs(vi->vdev, total_vqs, vqs, callbacks,
					 names, NULL);
	ret = virtio_find_vqs(vi->vdev, total_vqs, vqs, callbacks, names, NULL);
	if (ret)
		goto err_find;

+1 −2
Original line number Diff line number Diff line
@@ -175,8 +175,7 @@ int virtio_gpu_driver_load(struct drm_device *dev, unsigned long flags)
	DRM_INFO("virgl 3d acceleration not supported by guest\n");
#endif

	ret = vgdev->vdev->config->find_vqs(vgdev->vdev, 2, vqs,
					    callbacks, names, NULL);
	ret = virtio_find_vqs(vgdev->vdev, 2, vqs, callbacks, names, NULL);
	if (ret) {
		DRM_ERROR("failed to find virt queues\n");
		goto err_vqs;
+1 −2
Original line number Diff line number Diff line
@@ -679,8 +679,7 @@ static int cfv_probe(struct virtio_device *vdev)
		goto err;

	/* Get the TX virtio ring. This is a "guest side vring". */
	err = vdev->config->find_vqs(vdev, 1, &cfv->vq_tx, &vq_cbs, &names,
			NULL);
	err = virtio_find_vqs(vdev, 1, &cfv->vq_tx, &vq_cbs, &names, NULL);
	if (err)
		goto err;

Loading