mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-24 01:00:52 +07:00
crypto: atmel-sha204a - Use device-managed registration API
Use devm_hwrng_register to get rid of manual unregistration. Signed-off-by: Chuhong Yuan <hslester96@gmail.com> Acked-by: Ludovic Desroches <ludovic.desroches@microchip.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
parent
c9f1fd4f2f
commit
01970282a4
@ -109,7 +109,7 @@ static int atmel_sha204a_probe(struct i2c_client *client,
|
||||
i2c_priv->hwrng.read = atmel_sha204a_rng_read;
|
||||
i2c_priv->hwrng.quality = 1024;
|
||||
|
||||
ret = hwrng_register(&i2c_priv->hwrng);
|
||||
ret = devm_hwrng_register(&client->dev, &i2c_priv->hwrng);
|
||||
if (ret)
|
||||
dev_warn(&client->dev, "failed to register RNG (%d)\n", ret);
|
||||
|
||||
@ -127,7 +127,6 @@ static int atmel_sha204a_remove(struct i2c_client *client)
|
||||
|
||||
if (i2c_priv->hwrng.priv)
|
||||
kfree((void *)i2c_priv->hwrng.priv);
|
||||
hwrng_unregister(&i2c_priv->hwrng);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user