diff options
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; |