diff options
author | Axel Lin <axel.lin@ingics.com> | 2013-08-26 21:07:23 -0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2013-08-28 07:34:18 -0400 |
commit | 394a8ff8bb260cc3a39f67b7f3dbf05c95174257 (patch) | |
tree | 4d1fc2485047b5b4a063cb9751b9be11533ce6e8 | |
parent | 51578b9b1f6a9299e36fcf1554ff8cdf79372bd3 (diff) |
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>
-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 637bcd341c7d..be7e900fb298 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, | |||
643 | 643 | ||
644 | for (i = 0; i < pmx->nbanks; i++) { | 644 | for (i = 0; i < pmx->nbanks; i++) { |
645 | res = platform_get_resource(pdev, IORESOURCE_MEM, i); | 645 | res = platform_get_resource(pdev, IORESOURCE_MEM, i); |
646 | if (!res) { | 646 | pmx->regs[i] = devm_ioremap_resource(&pdev->dev, res); |
647 | dev_err(&pdev->dev, "Missing MEM resource\n"); | 647 | if (IS_ERR(pmx->regs[i])) |
648 | return -ENODEV; | 648 | return PTR_ERR(pmx->regs[i]); |
649 | } | ||
650 | |||
651 | if (!devm_request_mem_region(&pdev->dev, res->start, | ||
652 | resource_size(res), | ||
653 | dev_name(&pdev->dev))) { | ||
654 | dev_err(&pdev->dev, | ||
655 | "Couldn't request MEM resource %d\n", i); | ||
656 | return -ENODEV; | ||
657 | } | ||
658 | |||
659 | pmx->regs[i] = devm_ioremap(&pdev->dev, res->start, | ||
660 | resource_size(res)); | ||
661 | if (!pmx->regs[i]) { | ||
662 | dev_err(&pdev->dev, "Couldn't ioremap regs %d\n", i); | ||
663 | return -ENODEV; | ||
664 | } | ||
665 | } | 649 | } |
666 | 650 | ||
667 | pmx->pctl = pinctrl_register(&tegra_pinctrl_desc, &pdev->dev, pmx); | 651 | pmx->pctl = pinctrl_register(&tegra_pinctrl_desc, &pdev->dev, pmx); |