]> xenbits.xensource.com Git - arm/linux.git/commitdiff
hwrng: imx-rngc - use devm_platform_ioremap_resource() to simplify code
authorAnson Huang <Anson.Huang@nxp.com>
Wed, 17 Jul 2019 09:04:37 +0000 (17:04 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Sat, 27 Jul 2019 11:08:32 +0000 (21:08 +1000)
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>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Dong Aisheng <aisheng.dong@nxp.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/char/hw_random/imx-rngc.c

index 69f537980004978fba432784d6e54490c796b4b9..30cf00f8e9a09ad3c57b0c4190080cd38311f669 100644 (file)
@@ -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);