hwrng: drivers - Use device-managed registration API
Use devm_hwrng_register to simplify the implementation. Manual unregistration and some remove functions can be removed now. Signed-off-by: Chuhong Yuan <hslester96@gmail.com> Acked-by: Łukasz Stelmach <l.stelmach@samsung.com> Acked-by: Ludovic Desroches <ludovic.desroches@microchip.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
@@ -768,7 +768,7 @@ static int n2rng_probe(struct platform_device *op)
|
||||
np->hwrng.data_read = n2rng_data_read;
|
||||
np->hwrng.priv = (unsigned long) np;
|
||||
|
||||
err = hwrng_register(&np->hwrng);
|
||||
err = devm_hwrng_register(&pdev->dev, &np->hwrng);
|
||||
if (err)
|
||||
goto out_hvapi_unregister;
|
||||
|
||||
@@ -793,8 +793,6 @@ static int n2rng_remove(struct platform_device *op)
|
||||
|
||||
cancel_delayed_work_sync(&np->work);
|
||||
|
||||
hwrng_unregister(&np->hwrng);
|
||||
|
||||
sun4v_hvapi_unregister(HV_GRP_RNG);
|
||||
|
||||
return 0;
|
||||
|
Reference in New Issue
Block a user