clk: davinci: use devm_platform_ioremap_resource() to simplify code
authorYueHaibing <yuehaibing@huawei.com>
Mon, 14 Oct 2019 14:44:07 +0000 (22:44 +0800)
committerStephen Boyd <sboyd@kernel.org>
Wed, 16 Oct 2019 23:17:14 +0000 (16:17 -0700)
Use devm_platform_ioremap_resource() to simplify the code a bit.
This is detected by coccinelle.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Link: https://lkml.kernel.org/r/20191014144407.23264-1-yuehaibing@huawei.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
drivers/clk/davinci/pll.c
drivers/clk/davinci/psc.c

index 1ac11b6a47a37177c0c3c97d1903066a8c3fa3c6..8a23d5dfd1f8dbb6d6984c03e7d2e3f433a354c4 100644 (file)
@@ -910,7 +910,6 @@ static int davinci_pll_probe(struct platform_device *pdev)
        struct davinci_pll_platform_data *pdata;
        const struct of_device_id *of_id;
        davinci_pll_init pll_init = NULL;
-       struct resource *res;
        void __iomem *base;
 
        of_id = of_match_device(davinci_pll_of_match, dev);
@@ -930,8 +929,7 @@ static int davinci_pll_probe(struct platform_device *pdev)
                return -EINVAL;
        }
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       base = devm_ioremap_resource(dev, res);
+       base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(base))
                return PTR_ERR(base);
 
index 5b69e24a224f4797c263bcf3e43115fa09513bc1..7387e7f6276eb40a4a24f5e354edd1fbb9f8c304 100644 (file)
@@ -531,7 +531,6 @@ static int davinci_psc_probe(struct platform_device *pdev)
        struct device *dev = &pdev->dev;
        const struct of_device_id *of_id;
        const struct davinci_psc_init_data *init_data = NULL;
-       struct resource *res;
        void __iomem *base;
        int ret;
 
@@ -546,8 +545,7 @@ static int davinci_psc_probe(struct platform_device *pdev)
                return -EINVAL;
        }
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       base = devm_ioremap_resource(dev, res);
+       base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(base))
                return PTR_ERR(base);