* [PATCH v2] pinctrl: tegra: Convert to devm_ioremap_resource
@ 2013-08-27 1:07 Axel Lin
2013-08-27 4:00 ` Stephen Warren
2013-08-28 11:22 ` Linus Walleij
0 siblings, 2 replies; 3+ messages in thread
From: Axel Lin @ 2013-08-27 1:07 UTC (permalink / raw)
To: Linus Walleij; +Cc: Stephen Warren, linux-tegra-u79uwXL29TY76Z2rM5mHXA
Using the new devm_ioremap_resource() we can greatly simplify resource handling.
Signed-off-by: Axel Lin <axel.lin-8E1dMatC8ynQT0dZR+AlfA@public.gmane.org>
---
v2: add commit log.
drivers/pinctrl/pinctrl-tegra.c | 22 +++-------------------
1 file 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);
--
1.8.1.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] pinctrl: tegra: Convert to devm_ioremap_resource
2013-08-27 1:07 [PATCH v2] pinctrl: tegra: Convert to devm_ioremap_resource Axel Lin
@ 2013-08-27 4:00 ` Stephen Warren
2013-08-28 11:22 ` Linus Walleij
1 sibling, 0 replies; 3+ messages in thread
From: Stephen Warren @ 2013-08-27 4:00 UTC (permalink / raw)
To: Axel Lin; +Cc: Linus Walleij, linux-tegra-u79uwXL29TY76Z2rM5mHXA
On 08/26/2013 07:07 PM, Axel Lin wrote:
> Using the new devm_ioremap_resource() we can greatly simplify resource handling.
Seems plausible,
Acked-by: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
(I said that last time)
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] pinctrl: tegra: Convert to devm_ioremap_resource
2013-08-27 1:07 [PATCH v2] pinctrl: tegra: Convert to devm_ioremap_resource Axel Lin
2013-08-27 4:00 ` Stephen Warren
@ 2013-08-28 11:22 ` Linus Walleij
1 sibling, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2013-08-28 11:22 UTC (permalink / raw)
To: Axel Lin
Cc: Stephen Warren,
linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
On Tue, Aug 27, 2013 at 3:07 AM, Axel Lin <axel.lin-8E1dMatC8ynQT0dZR+AlfA@public.gmane.org> wrote:
> Using the new devm_ioremap_resource() we can greatly simplify resource handling.
>
> Signed-off-by: Axel Lin <axel.lin-8E1dMatC8ynQT0dZR+AlfA@public.gmane.org>
> ---
> v2: add commit log.
Patch applied with Stephen's ACK.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-08-28 11:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-27 1:07 [PATCH v2] pinctrl: tegra: Convert to devm_ioremap_resource Axel Lin
2013-08-27 4:00 ` Stephen Warren
2013-08-28 11:22 ` Linus Walleij
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox