summaryrefslogtreecommitdiff
path: root/drivers/pinctrl/spear
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@ingics.com>2013-08-26 08:20:45 +0800
committerLinus Walleij <linus.walleij@linaro.org>2013-08-28 13:34:18 +0200
commitdff5a99c2ae537cad2fc4df85ef3330a4ddf2c67 (patch)
tree23fcbf48ef0912661d202014504f3d8a848f6fa7 /drivers/pinctrl/spear
parent0be9e70d5808938c595199caa8368b734ba3539a (diff)
pinctrl: spear: Convert to devm_ioremap_resource
Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/spear')
-rw-r--r--drivers/pinctrl/spear/pinctrl-spear.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/pinctrl/spear/pinctrl-spear.c b/drivers/pinctrl/spear/pinctrl-spear.c
index 116da0412c4b..58bf6867aa17 100644
--- a/drivers/pinctrl/spear/pinctrl-spear.c
+++ b/drivers/pinctrl/spear/pinctrl-spear.c
@@ -367,21 +367,16 @@ int spear_pinctrl_probe(struct platform_device *pdev,
if (!machdata)
return -ENODEV;
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (!res)
- return -EINVAL;
-
pmx = devm_kzalloc(&pdev->dev, sizeof(*pmx), GFP_KERNEL);
if (!pmx) {
dev_err(&pdev->dev, "Can't alloc spear_pmx\n");
return -ENOMEM;
}
- pmx->vbase = devm_ioremap(&pdev->dev, res->start, resource_size(res));
- if (!pmx->vbase) {
- dev_err(&pdev->dev, "Couldn't ioremap at index 0\n");
- return -ENODEV;
- }
+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ pmx->vbase = devm_ioremap_resource(&pdev->dev, res);
+ if (IS_ERR(pmx->vbase))
+ return PTR_ERR(pmx->vbase);
pmx->dev = &pdev->dev;
pmx->machdata = machdata;