char: hw_random: imx-rngc: use devm_platform_ioremap_resource() to simplify code
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
@@ -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
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
@@ -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
Quoted 8 lines · On Wed, Jul 17, 2019 at 11:14 AM <[email protected]> wrote:
From: Anson Huang <[email protected]>
Use the new helper
devm_platform_ioremap_resource()which wraps theplatform_get_resource()anddevm_ioremap_resource()together, to simplify the code.Signed-off-by Anson Huang <[email protected]>
Both patches
Quoted 8 lines
From: [email protected] <[email protected]>
Sent: Wednesday, July 17, 2019 5:05 PMUse the new helper
devm_platform_ioremap_resource()which wraps theplatform_get_resource()anddevm_ioremap_resource()together, to simplify the code.Signed-off-by Anson Huang <[email protected]>
Regards
Aisheng
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 PMUse the new helper
devm_platform_ioremap_resource()which wraps theplatform_get_resource()anddevm_ioremap_resource()together, to simplify the code.Signed-off-by Anson Huang <[email protected]>
Regards
Aisheng
Herbert Xu
maintainerQuoted 10 lines · [email protected] wrote:
From: Anson Huang <[email protected]>
Use the new helper
devm_platform_ioremap_resource()which wraps theplatform_get_resource()anddevm_ioremap_resource()together, to simplify the code.Signed-off-by Anson Huang <[email protected]>---
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