hwrng: iproc-rng200 - Use devm_platform_ioremap_resource() in iproc_rng200_probe()
Subsystems (4)
PATCH 1/1 hwrng: iproc-rng200 - Use devm_platform_ioremap_resource() in iproc_rng200_probe()
From: Markus Elfring <[email protected]>
Date: Wed, 18 Sep 2019 09:09:22 +0200
Simplify this function implementation by using a known wrapper function.
This issue was detected by using the Coccinelle software.
--- drivers/char/hw_random/iproc-rng200.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-)
drivers/char/hw_random/iproc-rng200.c +1 -8
@@ -181,7 +181,6 @@ static void iproc_rng200_cleanup(struct hwrng *rng)static int iproc_rng200_probe (struct platform_device *pdev) {struct iproc_rng200_dev *priv; -struct resource *res;struct device *dev = &pdev->dev;int ret;
@@ -190,13 +189,7 @@ static int iproc_rng200_probe(struct platform_device *pdev)return -ENOMEM ;/* Map peripheral */ - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); -if (!res) { -dev_err (dev,"failed to get rng resources\n" ); -return -EINVAL ; - } - - priv->base =devm_ioremap_resource (dev, res); + priv->base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (priv->base)) {dev_err (dev,"failed to remap rng regs\n" );return PTR_ERR (priv->base);
--
2.23.0
Quoted 40 lines · Markus Elfring
From: Markus Elfring <[email protected]>
Date: Wed, 18 Sep 2019 09:09:22 +0200Simplify this function implementation by using a known wrapper function.
This issue was detected by using the Coccinelle software.
Signed-off-by Markus Elfring <[email protected]>--- drivers/char/hw_random/iproc-rng200.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-)drivers/char/hw_random/iproc-rng200.c +1
-9@@ -181,7 +181,6 @@ static void iproc_rng200_cleanup(struct hwrng *rng)static int iproc_rng200_probe (struct platform_device *pdev) {struct iproc_rng200_dev *priv; -struct resource *res;struct device *dev = &pdev->dev;int ret;@@ -190,13 +189,7 @@ static int iproc_rng200_probe(struct platform_device *pdev)return -ENOMEM ;/* Map peripheral */ - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); -if (!res) { -dev_err (dev,"failed to get rng resources\n" ); -return -EINVAL ; - } - - priv->base =devm_ioremap_resource (dev, res); + priv->base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (priv->base)) {dev_err (dev,"failed to remap rng regs\n" );return PTR_ERR (priv->base); --
Quoted 2 lines
2.23.0
Change looks good to me, thanks!
Quoted 8 lines · Markus Elfring
From: Markus Elfring <[email protected]>
Date: Wed, 18 Sep 2019 09:09:22 +0200Simplify this function implementation by using a known wrapper function.
This issue was detected by using the Coccinelle software.
Signed-off-by Markus Elfring <[email protected]>
Signature · 1 line
Florian
Herbert Xu
maintainerQuoted 11 lines · Markus Elfring
From: Markus Elfring <[email protected]>
Date: Wed, 18 Sep 2019 09:09:22 +0200Simplify this function implementation by using a known wrapper function.
This issue was detected by using the Coccinelle software.
Signed-off-by Markus Elfring <[email protected]>--- drivers/char/hw_random/iproc-rng200.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-)
Patch 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