hwrng: msm - make use of devm_hwrng_register
This allows us to get rid of remove() method. Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
parent
1e6e38a916
commit
9052b0dd45
1 changed files with 1 additions and 10 deletions
|
@ -157,7 +157,7 @@ static int msm_rng_probe(struct platform_device *pdev)
|
||||||
rng->hwrng.cleanup = msm_rng_cleanup,
|
rng->hwrng.cleanup = msm_rng_cleanup,
|
||||||
rng->hwrng.read = msm_rng_read,
|
rng->hwrng.read = msm_rng_read,
|
||||||
|
|
||||||
ret = hwrng_register(&rng->hwrng);
|
ret = devm_hwrng_register(&pdev->dev, &rng->hwrng);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
dev_err(&pdev->dev, "failed to register hwrng\n");
|
dev_err(&pdev->dev, "failed to register hwrng\n");
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -166,14 +166,6 @@ static int msm_rng_probe(struct platform_device *pdev)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int msm_rng_remove(struct platform_device *pdev)
|
|
||||||
{
|
|
||||||
struct msm_rng *rng = platform_get_drvdata(pdev);
|
|
||||||
|
|
||||||
hwrng_unregister(&rng->hwrng);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static const struct of_device_id msm_rng_of_match[] = {
|
static const struct of_device_id msm_rng_of_match[] = {
|
||||||
{ .compatible = "qcom,prng", },
|
{ .compatible = "qcom,prng", },
|
||||||
{}
|
{}
|
||||||
|
@ -182,7 +174,6 @@ MODULE_DEVICE_TABLE(of, msm_rng_of_match);
|
||||||
|
|
||||||
static struct platform_driver msm_rng_driver = {
|
static struct platform_driver msm_rng_driver = {
|
||||||
.probe = msm_rng_probe,
|
.probe = msm_rng_probe,
|
||||||
.remove = msm_rng_remove,
|
|
||||||
.driver = {
|
.driver = {
|
||||||
.name = KBUILD_MODNAME,
|
.name = KBUILD_MODNAME,
|
||||||
.of_match_table = of_match_ptr(msm_rng_of_match),
|
.of_match_table = of_match_ptr(msm_rng_of_match),
|
||||||
|
|
Loading…
Add table
Reference in a new issue