iio: adc: fsl-imx25-gcq: Use devm_platform_ioremap_resource
authorAishwarya Ramakrishnan <aishwaryarj100@gmail.com>
Sun, 12 Apr 2020 13:50:20 +0000 (19:20 +0530)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 19 Apr 2020 15:56:41 +0000 (16:56 +0100)
Use the helper function that wraps the calls to
platform_get_resource() and devm_ioremap_resource()
together. It reduces boilerplate and suggested by coccinelle.

Signed-off-by: Aishwarya Ramakrishnan <aishwaryarj100@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/fsl-imx25-gcq.c

index fa71489195c64b8a0480bb3f6d4cff202c69b67a..b0a4dc88ba9b99155d7b546917082efb73e9c2ec 100644 (file)
@@ -294,7 +294,6 @@ static int mx25_gcq_probe(struct platform_device *pdev)
        struct mx25_gcq_priv *priv;
        struct mx25_tsadc *tsadc = dev_get_drvdata(pdev->dev.parent);
        struct device *dev = &pdev->dev;
-       struct resource *res;
        void __iomem *mem;
        int ret;
        int i;
@@ -305,8 +304,7 @@ static int mx25_gcq_probe(struct platform_device *pdev)
 
        priv = iio_priv(indio_dev);
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       mem = devm_ioremap_resource(dev, res);
+       mem = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(mem))
                return PTR_ERR(mem);