Commit e4db80d8 authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Herbert Xu

hwrng: virtio - Remove usage of the deprecated ida_simple_xx() API

ida_alloc() and ida_free() should be preferred to the deprecated
ida_simple_get() and ida_simple_remove().

This is less verbose.
Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 1bed8225
...@@ -135,7 +135,7 @@ static int probe_common(struct virtio_device *vdev) ...@@ -135,7 +135,7 @@ static int probe_common(struct virtio_device *vdev)
if (!vi) if (!vi)
return -ENOMEM; return -ENOMEM;
vi->index = index = ida_simple_get(&rng_index_ida, 0, 0, GFP_KERNEL); vi->index = index = ida_alloc(&rng_index_ida, GFP_KERNEL);
if (index < 0) { if (index < 0) {
err = index; err = index;
goto err_ida; goto err_ida;
...@@ -166,7 +166,7 @@ static int probe_common(struct virtio_device *vdev) ...@@ -166,7 +166,7 @@ static int probe_common(struct virtio_device *vdev)
return 0; return 0;
err_find: err_find:
ida_simple_remove(&rng_index_ida, index); ida_free(&rng_index_ida, index);
err_ida: err_ida:
kfree(vi); kfree(vi);
return err; return err;
...@@ -184,7 +184,7 @@ static void remove_common(struct virtio_device *vdev) ...@@ -184,7 +184,7 @@ static void remove_common(struct virtio_device *vdev)
hwrng_unregister(&vi->hwrng); hwrng_unregister(&vi->hwrng);
virtio_reset_device(vdev); virtio_reset_device(vdev);
vdev->config->del_vqs(vdev); vdev->config->del_vqs(vdev);
ida_simple_remove(&rng_index_ida, vi->index); ida_free(&rng_index_ida, vi->index);
kfree(vi); kfree(vi);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment