diff options
author | Axel Lin <axel.lin@ingics.com> | 2013-08-27 09:07:23 +0800 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2013-08-28 13:34:18 +0200 |
commit | 394a8ff8bb260cc3a39f67b7f3dbf05c95174257 (patch) | |
tree | 4d1fc2485047b5b4a063cb9751b9be11533ce6e8 /drivers/pinctrl/pinctrl-tegra.c | |
parent | 51578b9b1f6a9299e36fcf1554ff8cdf79372bd3 (diff) | |
download | op-kernel-dev-394a8ff8bb260cc3a39f67b7f3dbf05c95174257.zip op-kernel-dev-394a8ff8bb260cc3a39f67b7f3dbf05c95174257.tar.gz |
pinctrl: tegra: Convert to devm_ioremap_resource
Using the new devm_ioremap_resource() we can greatly simplify resource handling.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/pinctrl-tegra.c')
-rw-r--r-- | drivers/pinctrl/pinctrl-tegra.c | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/drivers/pinctrl/pinctrl-tegra.c b/drivers/pinctrl/pinctrl-tegra.c index 637bcd3..be7e900 100644 --- a/drivers/pinctrl/pinctrl-tegra.c +++ b/drivers/pinctrl/pinctrl-tegra.c @@ -643,25 +643,9 @@ int tegra_pinctrl_probe(struct platform_device *pdev, for (i = 0; i < pmx->nbanks; i++) { res = platform_get_resource(pdev, IORESOURCE_MEM, i); - if (!res) { - dev_err(&pdev->dev, "Missing MEM resource\n"); - return -ENODEV; - } - - if (!devm_request_mem_region(&pdev->dev, res->start, - resource_size(res), - dev_name(&pdev->dev))) { - dev_err(&pdev->dev, - "Couldn't request MEM resource %d\n", i); - return -ENODEV; - } - - pmx->regs[i] = devm_ioremap(&pdev->dev, res->start, - resource_size(res)); - if (!pmx->regs[i]) { - dev_err(&pdev->dev, "Couldn't ioremap regs %d\n", i); - return -ENODEV; - } + pmx->regs[i] = devm_ioremap_resource(&pdev->dev, res); + if (IS_ERR(pmx->regs[i])) + return PTR_ERR(pmx->regs[i]); } pmx->pctl = pinctrl_register(&tegra_pinctrl_desc, &pdev->dev, pmx); |