===================================================================
@@ -237,23 +237,23 @@ static void kvm_del_vqs(struct virtio_de
int i;
if (!kdev->vqs)
return;
- for (i = 0; i < ldev->nvqs; ++i)
+ for (i = 0; i < kdev->nvqs; ++i)
kvm_del_vq(kdev->vqs[i]);
- kfree(ldev->vqs);
- ldev->vqs = NULL;
- ldev->nvqs = 0;
+ kfree(kdev->vqs);
+ kdev->vqs = NULL;
+ kdev->nvqs = 0;
}
static int kvm_find_vqs(struct virtio_device *vdev, unsigned nvqs,
- struct virtqueue *vqs[]
- void (*callbacks)[](struct virtqueue *))
+ struct virtqueue *vqs[],
+ virtqueue_callback *callbacks[])
{
struct kvm_device *kdev = to_kvmdev(vdev);
int i;
/* We must have this many virtqueues. */
if (nvqs > kdev->desc->num_vq)
- return ERR_PTR(-ENOENT);
+ return -ENOENT;
kdev->vqs = kmalloc(GFP_KERNEL, nvqs * sizeof *kdev->vqs);
if (!kdev->vqs)
@@ -272,20 +272,6 @@ error:
return PTR_ERR(vqs[i]);
}
-static void kvm_del_vqs(struct virtio_device *vdev)
-{
- struct lguest_device *ldev = to_lgdev(vdev);
- int i;
-
- if (!ldev->vqs)
- return;
- for (i = 0; i < ldev->nvqs; ++i)
- lg_del_vq(ldev->vqs[i]);
- kfree(ldev->vqs);
- ldev->vqs = NULL;
- ldev->nvqs = 0;
-}
-
/*
* The config ops structure as defined by virtio config
*/