From 4b024225c4a8245e6ecc66ce1df1eaf2ebeb4acb Mon Sep 17 00:00:00 2001 From: YueHaibing Date: Mon, 4 Nov 2019 22:26:54 +0800 Subject: pinctrl: use devm_platform_ioremap_resource() to simplify code devm_platform_ioremap_resource() internally have platform_get_resource() and devm_ioremap_resource() in it. So instead of calling them separately use devm_platform_ioremap_resource() directly. Signed-off-by: YueHaibing Acked-by: Thierry Reding Acked-by: Neil Armstrong Acked-by: Manivannan Sadhasivam Acked-by: Jesper Nilsson Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20191104142654.39256-1-yuehaibing@huawei.com Signed-off-by: Linus Walleij --- drivers/pinctrl/pxa/pinctrl-pxa25x.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'drivers/pinctrl/pxa/pinctrl-pxa25x.c') diff --git a/drivers/pinctrl/pxa/pinctrl-pxa25x.c b/drivers/pinctrl/pxa/pinctrl-pxa25x.c index 8d1247078ae5..95640698422f 100644 --- a/drivers/pinctrl/pxa/pinctrl-pxa25x.c +++ b/drivers/pinctrl/pxa/pinctrl-pxa25x.c @@ -216,25 +216,20 @@ static int pxa25x_pinctrl_probe(struct platform_device *pdev) void __iomem *base_af[8]; void __iomem *base_dir[4]; void __iomem *base_sleep[4]; - struct resource *res; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - base_af[0] = devm_ioremap_resource(&pdev->dev, res); + base_af[0] = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(base_af[0])) return PTR_ERR(base_af[0]); - res = platform_get_resource(pdev, IORESOURCE_MEM, 1); - base_dir[0] = devm_ioremap_resource(&pdev->dev, res); + base_dir[0] = devm_platform_ioremap_resource(pdev, 1); if (IS_ERR(base_dir[0])) return PTR_ERR(base_dir[0]); - res = platform_get_resource(pdev, IORESOURCE_MEM, 2); - base_dir[3] = devm_ioremap_resource(&pdev->dev, res); + base_dir[3] = devm_platform_ioremap_resource(pdev, 2); if (IS_ERR(base_dir[3])) return PTR_ERR(base_dir[3]); - res = platform_get_resource(pdev, IORESOURCE_MEM, 3); - base_sleep[0] = devm_ioremap_resource(&pdev->dev, res); + base_sleep[0] = devm_platform_ioremap_resource(pdev, 3); if (IS_ERR(base_sleep[0])) return PTR_ERR(base_sleep[0]); -- cgit v1.2.3