Use devm_platform_ioremap_resource() to simplify the code a bit.
This is detected by coccinelle.

Reported-by: Hulk Robot <hul...@huawei.com>
Signed-off-by: YueHaibing <yuehaib...@huawei.com>
---
 sound/soc/tegra/tegra20_das.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/sound/soc/tegra/tegra20_das.c b/sound/soc/tegra/tegra20_das.c
index 10f9c3b..1070b27 100644
--- a/sound/soc/tegra/tegra20_das.c
+++ b/sound/soc/tegra/tegra20_das.c
@@ -120,7 +120,6 @@ static const struct regmap_config tegra20_das_regmap_config 
= {
 
 static int tegra20_das_probe(struct platform_device *pdev)
 {
-       struct resource *res;
        void __iomem *regs;
        int ret = 0;
 
@@ -134,8 +133,7 @@ static int tegra20_das_probe(struct platform_device *pdev)
        }
        das->dev = &pdev->dev;
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       regs = devm_ioremap_resource(&pdev->dev, res);
+       regs = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(regs)) {
                ret = PTR_ERR(regs);
                goto err;
-- 
2.7.4


Reply via email to