diff options
author | Jiri Pirko <jiri@nvidia.com> | 2024-07-08 10:48:12 +0300 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2024-07-17 12:20:58 +0300 |
commit | c95e67bac42d7e671e6a2c14548b6a7f76e71235 (patch) | |
tree | f0fc2e0608f068a3f99dd700850554baa968a4f5 /sound | |
parent | 7221922da2a1eb8bbc8d6570cec1197c8f484517 (diff) | |
download | linux-c95e67bac42d7e671e6a2c14548b6a7f76e71235.tar.xz |
virtio: convert the rest virtio_find_vqs() users to virtio_find_vqs_info()
Instead of passing separate names and callbacks arrays
to virtio_find_vqs(), have one of virtual_queue_info structs and
pass it to virtio_find_vqs_info().
Suggested-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
Signed-off-by: Jiri Pirko <jiri@nvidia.com>
Message-Id: <20240708074814.1739223-18-jiri@resnulli.us>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/virtio/virtio_card.c | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/sound/virtio/virtio_card.c b/sound/virtio/virtio_card.c index 7805daea0102..109a0008b69e 100644 --- a/sound/virtio/virtio_card.c +++ b/sound/virtio/virtio_card.c @@ -110,25 +110,22 @@ static void virtsnd_event_notify_cb(struct virtqueue *vqueue) static int virtsnd_find_vqs(struct virtio_snd *snd) { struct virtio_device *vdev = snd->vdev; - static vq_callback_t *callbacks[VIRTIO_SND_VQ_MAX] = { - [VIRTIO_SND_VQ_CONTROL] = virtsnd_ctl_notify_cb, - [VIRTIO_SND_VQ_EVENT] = virtsnd_event_notify_cb, - [VIRTIO_SND_VQ_TX] = virtsnd_pcm_tx_notify_cb, - [VIRTIO_SND_VQ_RX] = virtsnd_pcm_rx_notify_cb - }; - static const char *names[VIRTIO_SND_VQ_MAX] = { - [VIRTIO_SND_VQ_CONTROL] = "virtsnd-ctl", - [VIRTIO_SND_VQ_EVENT] = "virtsnd-event", - [VIRTIO_SND_VQ_TX] = "virtsnd-tx", - [VIRTIO_SND_VQ_RX] = "virtsnd-rx" + struct virtqueue_info vqs_info[VIRTIO_SND_VQ_MAX] = { + [VIRTIO_SND_VQ_CONTROL] = { "virtsnd-ctl", + virtsnd_ctl_notify_cb }, + [VIRTIO_SND_VQ_EVENT] = { "virtsnd-event", + virtsnd_event_notify_cb }, + [VIRTIO_SND_VQ_TX] = { "virtsnd-tx", + virtsnd_pcm_tx_notify_cb }, + [VIRTIO_SND_VQ_RX] = { "virtsnd-rx", + virtsnd_pcm_rx_notify_cb }, }; struct virtqueue *vqs[VIRTIO_SND_VQ_MAX] = { 0 }; unsigned int i; unsigned int n; int rc; - rc = virtio_find_vqs(vdev, VIRTIO_SND_VQ_MAX, vqs, callbacks, names, - NULL); + rc = virtio_find_vqs_info(vdev, VIRTIO_SND_VQ_MAX, vqs, vqs_info, NULL); if (rc) { dev_err(&vdev->dev, "failed to initialize virtqueues\n"); return rc; |