summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAhmad Fatoum <ahmad@a3f.at>2021-02-28 20:08:30 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2021-03-01 17:29:10 +0100
commit598217bad38f62aa1691742839cfe856ba2a99e2 (patch)
tree5a1f88ac72a8b1defba95f9a5c77e81bdeeeee51
parentfceb9a280d74dae2d5f989fe240aaa20d3f29a80 (diff)
downloadbarebox-598217bad38f62aa1691742839cfe856ba2a99e2.tar.gz
barebox-598217bad38f62aa1691742839cfe856ba2a99e2.tar.xz
hw_random: virtio: simplify code
The Linux code did a bit more than we do, but after deleting the unneeded parts virtrng_probe and virtrng_remove do nothing but call probe_common/remove_common. Drop the intermediate functions. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--drivers/hw_random/virtio-rng.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/drivers/hw_random/virtio-rng.c b/drivers/hw_random/virtio-rng.c
index fbf1a5715a..7bdacc976e 100644
--- a/drivers/hw_random/virtio-rng.c
+++ b/drivers/hw_random/virtio-rng.c
@@ -61,7 +61,7 @@ static int virtio_rng_read(struct hwrng *hwrng, void *data, size_t len, bool wai
return len;
}
-static int probe_common(struct virtio_device *vdev)
+static int virtrng_probe(struct virtio_device *vdev)
{
struct virtrng_info *vi;
@@ -76,22 +76,12 @@ static int probe_common(struct virtio_device *vdev)
return virtio_find_vqs(vdev, 1, &vi->rng_vq);
}
-static void remove_common(struct virtio_device *vdev)
+static void virtrng_remove(struct virtio_device *vdev)
{
vdev->config->reset(vdev);
vdev->config->del_vqs(vdev);
}
-static int virtrng_probe(struct virtio_device *vdev)
-{
- return probe_common(vdev);
-}
-
-static void virtrng_remove(struct virtio_device *vdev)
-{
- remove_common(vdev);
-}
-
static void virtrng_scan(struct virtio_device *vdev)
{
struct virtrng_info *vi = vdev->priv;