lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1426194007-22182-7-git-send-email-dmitry.torokhov@gmail.com>
Date:	Thu, 12 Mar 2015 14:00:07 -0700
From:	Dmitry Torokhov <dmitry.torokhov@...il.com>
To:	Herbert Xu <herbert@...dor.apana.org.au>
Cc:	linux-crypto@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH 6/6] hwrng: iproc-rng200 - make use of devm_hwrng_register

This allows us to get rid of driver's remove() method.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@...il.com>
---
 drivers/char/hw_random/iproc-rng200.c | 15 +--------------
 1 file changed, 1 insertion(+), 14 deletions(-)

diff --git a/drivers/char/hw_random/iproc-rng200.c b/drivers/char/hw_random/iproc-rng200.c
index 2dbaf5c..3eaf7cb 100644
--- a/drivers/char/hw_random/iproc-rng200.c
+++ b/drivers/char/hw_random/iproc-rng200.c
@@ -208,29 +208,17 @@ static int iproc_rng200_probe(struct platform_device *pdev)
 	priv->rng.cleanup = iproc_rng200_cleanup,
 
 	/* Register driver */
-	ret = hwrng_register(&priv->rng);
+	ret = devm_hwrng_register(dev, &priv->rng);
 	if (ret) {
 		dev_err(dev, "hwrng registration failed\n");
 		return ret;
 	}
 
-	platform_set_drvdata(pdev, priv);
-
 	dev_info(dev, "hwrng registered\n");
 
 	return 0;
 }
 
-static int iproc_rng200_remove(struct platform_device *pdev)
-{
-	struct iproc_rng200_dev *priv = platform_get_drvdata(pdev);
-
-	/* Unregister driver */
-	hwrng_unregister(&priv->rng);
-
-	return 0;
-}
-
 static const struct of_device_id iproc_rng200_of_match[] = {
 	{ .compatible = "brcm,iproc-rng200", },
 	{},
@@ -243,7 +231,6 @@ static struct platform_driver iproc_rng200_driver = {
 		.of_match_table = iproc_rng200_of_match,
 	},
 	.probe		= iproc_rng200_probe,
-	.remove		= iproc_rng200_remove,
 };
 module_platform_driver(iproc_rng200_driver);
 
-- 
2.2.0.rc0.207.ga3a616c

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ