diff options
author | Axel Lin <axel.lin@ingics.com> | 2013-08-25 20:20:45 -0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2013-08-28 07:34:18 -0400 |
commit | dff5a99c2ae537cad2fc4df85ef3330a4ddf2c67 (patch) | |
tree | 23fcbf48ef0912661d202014504f3d8a848f6fa7 /drivers/pinctrl/spear | |
parent | 0be9e70d5808938c595199caa8368b734ba3539a (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.c | 13 |
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, | |||
367 | if (!machdata) | 367 | if (!machdata) |
368 | return -ENODEV; | 368 | return -ENODEV; |
369 | 369 | ||
370 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
371 | if (!res) | ||
372 | return -EINVAL; | ||
373 | |||
374 | pmx = devm_kzalloc(&pdev->dev, sizeof(*pmx), GFP_KERNEL); | 370 | pmx = devm_kzalloc(&pdev->dev, sizeof(*pmx), GFP_KERNEL); |
375 | if (!pmx) { | 371 | if (!pmx) { |
376 | dev_err(&pdev->dev, "Can't alloc spear_pmx\n"); | 372 | dev_err(&pdev->dev, "Can't alloc spear_pmx\n"); |
377 | return -ENOMEM; | 373 | return -ENOMEM; |
378 | } | 374 | } |
379 | 375 | ||
380 | pmx->vbase = devm_ioremap(&pdev->dev, res->start, resource_size(res)); | 376 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
381 | if (!pmx->vbase) { | 377 | pmx->vbase = devm_ioremap_resource(&pdev->dev, res); |
382 | dev_err(&pdev->dev, "Couldn't ioremap at index 0\n"); | 378 | if (IS_ERR(pmx->vbase)) |
383 | return -ENODEV; | 379 | return PTR_ERR(pmx->vbase); |
384 | } | ||
385 | 380 | ||
386 | pmx->dev = &pdev->dev; | 381 | pmx->dev = &pdev->dev; |
387 | pmx->machdata = machdata; | 382 | pmx->machdata = machdata; |