ASoC: fsl_audmix: use devm_platform_ioremap_resource() to simplify code
authorYueHaibing <yuehaibing@huawei.com>
Sat, 27 Jul 2019 15:07:12 +0000 (23:07 +0800)
committerMark Brown <broonie@kernel.org>
Wed, 31 Jul 2019 11:04:59 +0000 (12:04 +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-9-yuehaibing@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/fsl/fsl_audmix.c

index 3897a54a11fe40c84fc3c90554e011ff89c4af42..c7e4e9757dce9246ab466424329d686154889bf0 100644 (file)
@@ -458,7 +458,6 @@ static int fsl_audmix_probe(struct platform_device *pdev)
 {
        struct device *dev = &pdev->dev;
        struct fsl_audmix *priv;
-       struct resource *res;
        const char *mdrv;
        const struct of_device_id *of_id;
        void __iomem *regs;
@@ -475,8 +474,7 @@ static int fsl_audmix_probe(struct platform_device *pdev)
                return -ENOMEM;
 
        /* Get the addresses */
-       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);