]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
pinctrl: mvebu: use devm_platform_ioremap_resource() to simplify code
authorYueHaibing <yuehaibing@huawei.com>
Wed, 16 Oct 2019 14:12:17 +0000 (22:12 +0800)
committerLinus Walleij <linus.walleij@linaro.org>
Thu, 24 Oct 2019 12:04:13 +0000 (14:04 +0200)
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://lore.kernel.org/r/20191016141217.21520-1-yuehaibing@huawei.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/mvebu/pinctrl-mvebu.c
drivers/pinctrl/mvebu/pinctrl-orion.c

index 00cfaf2c9d4a0b0ab57da8138d2a652f9a968507..a1f93859e7ca557d55e9f7eb41a95dfbc696ce18 100644 (file)
@@ -759,12 +759,10 @@ int mvebu_pinctrl_simple_mmio_probe(struct platform_device *pdev)
 {
        struct mvebu_pinctrl_soc_info *soc = dev_get_platdata(&pdev->dev);
        struct mvebu_mpp_ctrl_data *mpp_data;
-       struct resource *res;
        void __iomem *base;
        int i;
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       base = devm_ioremap_resource(&pdev->dev, res);
+       base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(base))
                return PTR_ERR(base);
 
index 29bb9d8cbbb5bafc9a4288cc3a3af00920a35a3c..cc97d270be61b4594c08668be8e0865152f706f3 100644 (file)
@@ -220,17 +220,14 @@ static int orion_pinctrl_probe(struct platform_device *pdev)
 {
        const struct of_device_id *match =
                of_match_device(orion_pinctrl_of_match, &pdev->dev);
-       struct resource *res;
 
        pdev->dev.platform_data = (void*)match->data;
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       mpp_base = devm_ioremap_resource(&pdev->dev, res);
+       mpp_base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(mpp_base))
                return PTR_ERR(mpp_base);
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
-       high_mpp_base = devm_ioremap_resource(&pdev->dev, res);
+       high_mpp_base = devm_platform_ioremap_resource(pdev, 1);
        if (IS_ERR(high_mpp_base))
                return PTR_ERR(high_mpp_base);