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

Commit 6fbbcf38 authored by Julien Cristau's avatar Julien Cristau Committed by Greg Kroah-Hartman
Browse files

hwrng: chaoskey - drop workaround for old hwrng core limitation



The hwrng core used to mask 'quality' with 1023; that has been removed
in commit 506bf0c0 ("hwrng: core - allow
perfect entropy from hardware devices"), so we can now just set quality
to 1024.

Signed-off-by: default avatarJulien Cristau <jcristau@debian.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 054d4b7b
Loading
Loading
Loading
Loading
+1 −13
Original line number Original line Diff line number Diff line
@@ -215,19 +215,7 @@ static int chaoskey_probe(struct usb_interface *interface,


	dev->hwrng.name = dev->name ? dev->name : chaoskey_driver.name;
	dev->hwrng.name = dev->name ? dev->name : chaoskey_driver.name;
	dev->hwrng.read = chaoskey_rng_read;
	dev->hwrng.read = chaoskey_rng_read;

	dev->hwrng.quality = 1024;
	/* Set the 'quality' metric.  Quality is measured in units of
	 * 1/1024's of a bit ("mills"). This should be set to 1024,
	 * but there is a bug in the hwrng core which masks it with
	 * 1023.
	 *
	 * The patch that has been merged to the crypto development
	 * tree for that bug limits the value to 1024 at most, so by
	 * setting this to 1024 + 1023, we get 1023 before the fix is
	 * merged and 1024 afterwards. We'll patch this driver once
	 * both bits of code are in the same tree.
	 */
	dev->hwrng.quality = 1024 + 1023;


	dev->hwrng_registered = (hwrng_register(&dev->hwrng) == 0);
	dev->hwrng_registered = (hwrng_register(&dev->hwrng) == 0);
	if (!dev->hwrng_registered)
	if (!dev->hwrng_registered)