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

index 78a6a360b4a65d83288b5abcc9c298ac954e301d..4b68d6ee75da4a5a00aaeeffd99efc81656baf54 100644 (file)
@@ -202,12 +202,11 @@ static int spdif_in_probe(struct platform_device *pdev)
 {
        struct spdif_in_dev *host;
        struct spear_spdif_platform_data *pdata;
-       struct resource *res, *res_fifo;
+       struct resource *res_fifo;
        void __iomem *io_base;
        int ret;
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       io_base = devm_ioremap_resource(&pdev->dev, res);
+       io_base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(io_base))
                return PTR_ERR(io_base);