[PATCH] hwrng: Add Arm SMCCC TRNG based driver

Mark Brown broonie at kernel.org
Fri Jun 4 10:14:39 PDT 2021


On Fri, Jun 04, 2021 at 06:02:16PM +0100, Andre Przywara wrote:

> +static int __init smccc_trng_dev_init(void)
> +{
> +	platform_device_register_simple("smccc_trng", -1, NULL, 0);
> +
> +	return 0;
> +}
> +
> +device_initcall(smccc_trng_dev_init);

This will leave the device registered if the driver is removed and cause
the attempt to register the device again to fail if the module is
reloaded.  We don't check the error here but I'm not sure the driver
core won't complain about that and it's generally icky, better to clean
up the device on module removal.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20210604/ab898437/attachment-0001.sig>


More information about the linux-arm-kernel mailing list