Skip to content

Commit

Permalink
pinctrl: spear: Convert to devm_ioremap_resource
Browse files Browse the repository at this point in the history
Signed-off-by: Axel Lin <[email protected]>
Acked-by: Viresh Kumar <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
  • Loading branch information
AxelLin authored and linusw committed Aug 28, 2013
1 parent 0be9e70 commit dff5a99
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions drivers/pinctrl/spear/pinctrl-spear.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit dff5a99

Please sign in to comment.