crypto: omap-des - Use devm_platform_get_and_ioremap_resource()
authorYangtao Li <frank.li@vivo.com>
Wed, 5 Jul 2023 07:21:54 +0000 (15:21 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 20 Jul 2023 10:16:24 +0000 (22:16 +1200)
Convert platform_get_resource(), devm_ioremap_resource() to a single
call to devm_platform_get_and_ioremap_resource(), as this is exactly
what this function does.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/omap-des.c

index f783769ea1107239258e8c59e5a2b0f475e16efe..371a51094e3460ba1af49025f7fdff25ddaa89b5 100644 (file)
@@ -971,18 +971,12 @@ static int omap_des_probe(struct platform_device *pdev)
        dd->dev = dev;
        platform_set_drvdata(pdev, dd);
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       if (!res) {
-               dev_err(dev, "no MEM resource info\n");
-               goto err_res;
-       }
-
        err = (dev->of_node) ? omap_des_get_of(dd, pdev) :
                               omap_des_get_pdev(dd, pdev);
        if (err)
                goto err_res;
 
-       dd->io_base = devm_ioremap_resource(dev, res);
+       dd->io_base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
        if (IS_ERR(dd->io_base)) {
                err = PTR_ERR(dd->io_base);
                goto err_res;