linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] char: hw_random: imx-rngc: use devm_platform_ioremap_resource() to simplify code
@ 2019-07-17  9:04 Anson.Huang
  2019-07-17  9:04 ` [PATCH 2/2] char: hw_random: mxc-rnga: " Anson.Huang
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Anson.Huang @ 2019-07-17  9:04 UTC (permalink / raw)
  To: mpm, herbert, arnd, gregkh, shawnguo, s.hauer, kernel, festevam,
	rfontana, allison, kstewart, tglx, linux-crypto,
	linux-arm-kernel, linux-kernel
  Cc: Linux-imx

From: Anson Huang <Anson.Huang@nxp.com>

Use the new helper devm_platform_ioremap_resource() which wraps the
platform_get_resource() and devm_ioremap_resource() together, to
simplify the code.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
---
 drivers/char/hw_random/imx-rngc.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/char/hw_random/imx-rngc.c b/drivers/char/hw_random/imx-rngc.c
index 69f5379..30cf00f 100644
--- a/drivers/char/hw_random/imx-rngc.c
+++ b/drivers/char/hw_random/imx-rngc.c
@@ -196,7 +196,6 @@ static int imx_rngc_init(struct hwrng *rng)
 static int imx_rngc_probe(struct platform_device *pdev)
 {
 	struct imx_rngc *rngc;
-	struct resource *res;
 	int ret;
 	int irq;
 
@@ -204,8 +203,7 @@ static int imx_rngc_probe(struct platform_device *pdev)
 	if (!rngc)
 		return -ENOMEM;
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	rngc->base = devm_ioremap_resource(&pdev->dev, res);
+	rngc->base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(rngc->base))
 		return PTR_ERR(rngc->base);
 
-- 
2.7.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-07-26 12:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-17  9:04 [PATCH 1/2] char: hw_random: imx-rngc: use devm_platform_ioremap_resource() to simplify code Anson.Huang
2019-07-17  9:04 ` [PATCH 2/2] char: hw_random: mxc-rnga: " Anson.Huang
2019-07-17 10:24   ` Aisheng Dong
2019-07-17 10:13 ` [PATCH 1/2] char: hw_random: imx-rngc: " Arnd Bergmann
2019-07-17 10:24 ` Aisheng Dong
2019-07-26 12:34 ` Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).