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

index 72f4364b2d20fce3d5c0323d32cd38312c0da767..e3e5425b5c62cd86b2470db944f68be131f0305f 100644 (file)
@@ -399,7 +399,6 @@ static const struct snd_soc_component_driver mmp_sspa_component = {
 static int asoc_mmp_sspa_probe(struct platform_device *pdev)
 {
        struct sspa_priv *priv;
-       struct resource *res;
 
        priv = devm_kzalloc(&pdev->dev,
                                sizeof(struct sspa_priv), GFP_KERNEL);
@@ -417,8 +416,7 @@ static int asoc_mmp_sspa_probe(struct platform_device *pdev)
        if (priv->dma_params == NULL)
                return -ENOMEM;
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       priv->sspa->mmio_base = devm_ioremap_resource(&pdev->dev, res);
+       priv->sspa->mmio_base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(priv->sspa->mmio_base))
                return PTR_ERR(priv->sspa->mmio_base);