Skip to contentSkip to conversation

char: hw_random: imx-rngc: use devm_platform_ioremap_resource() to simplify code

PATCH In review [email protected] 4 participants 6 messages Jul 17, 2019 – Jul 26, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 char: hw_random: imx-rngc: use devm_platform_ioremap_resource() to simplify code

From: Anson Huang <[email protected]>

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

---
 drivers/char/hw_random/imx-rngc.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/char/hw_random/imx-rngc.c +1 -3
index 69f5379..30cf00f 100644
@@ -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);
 
Signature · 1 line
2.7.4
#1 lore raw

PATCH 2/2 char: hw_random: mxc-rnga: use devm_platform_ioremap_resource() to simplify code

From: Anson Huang <[email protected]>

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

---
 drivers/char/hw_random/mxc-rnga.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/char/hw_random/mxc-rnga.c +1 -3
index ea2bf18..025083c 100644
@@ -134,7 +134,6 @@ static void mxc_rnga_cleanup(struct hwrng *rng)
 static int __init mxc_rnga_probe(struct platform_device *pdev)
 {
 	int err;
-	struct resource *res;
 	struct mxc_rng *mxc_rng;
 
 	mxc_rng = devm_kzalloc(&pdev->dev, sizeof(*mxc_rng), GFP_KERNEL);
@@ -158,8 +157,7 @@ static int __init mxc_rnga_probe(struct platform_device *pdev)
 	if (err)
 		return err;
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	mxc_rng->mem = devm_ioremap_resource(&pdev->dev, res);
+	mxc_rng->mem = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(mxc_rng->mem)) {
 		err = PTR_ERR(mxc_rng->mem);
 		goto err_ioremap;
Signature · 1 line
2.7.4
Reviewed-by on v1 2/2
#2 lore raw

RE: [PATCH 2/2] char: hw_random: mxc-rnga: use devm_platform_ioremap_resource() to simplify code

In reply to [email protected]
Quoted 8 lines

From: [email protected] <[email protected]>
Sent: Wednesday, July 17, 2019 5:05 PM

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

Regards
Aisheng

maintainer
#5 lore raw
In reply to [email protected]
Quoted 10 lines · [email protected] wrote:

From: Anson Huang <[email protected]>

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

---
drivers/char/hw_random/imx-rngc.c | 4 +---

1 file changed, 1 insertion(+), 3 deletions(-)

All applied. Thanks.

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt