ASoC: meson: axg-fifo: use devm_platform_ioremap_resource() to simplify code
authorYueHaibing <yuehaibing@huawei.com>
Sat, 27 Jul 2019 15:07:34 +0000 (23:07 +0800)
committerMark Brown <broonie@kernel.org>
Wed, 31 Jul 2019 11:08:25 +0000 (12:08 +0100)
Use devm_platform_ioremap_resource() to simplify the code a bit.
This is detected by coccinelle.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Link: https://lore.kernel.org/r/20190727150738.54764-31-yuehaibing@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/meson/axg-fifo.c

index 01c1c7db251007f5b152ea1ea2c7b55a13e9e845..80a3dde35b5c6c8665e9d255ce28713a07d51107 100644 (file)
@@ -314,7 +314,6 @@ int axg_fifo_probe(struct platform_device *pdev)
        struct device *dev = &pdev->dev;
        const struct axg_fifo_match_data *data;
        struct axg_fifo *fifo;
-       struct resource *res;
        void __iomem *regs;
 
        data = of_device_get_match_data(dev);
@@ -328,8 +327,7 @@ int axg_fifo_probe(struct platform_device *pdev)
                return -ENOMEM;
        platform_set_drvdata(pdev, fifo);
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       regs = devm_ioremap_resource(dev, res);
+       regs = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(regs))
                return PTR_ERR(regs);