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>
This commit is contained in:
parent
0be9e70d58
commit
dff5a99c2a
|
@ -367,21 +367,16 @@ int spear_pinctrl_probe(struct platform_device *pdev,
|
||||||
if (!machdata)
|
if (!machdata)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
|
||||||
if (!res)
|
|
||||||
return -EINVAL;
|
|
||||||
|
|
||||||
pmx = devm_kzalloc(&pdev->dev, sizeof(*pmx), GFP_KERNEL);
|
pmx = devm_kzalloc(&pdev->dev, sizeof(*pmx), GFP_KERNEL);
|
||||||
if (!pmx) {
|
if (!pmx) {
|
||||||
dev_err(&pdev->dev, "Can't alloc spear_pmx\n");
|
dev_err(&pdev->dev, "Can't alloc spear_pmx\n");
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
pmx->vbase = devm_ioremap(&pdev->dev, res->start, resource_size(res));
|
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||||
if (!pmx->vbase) {
|
pmx->vbase = devm_ioremap_resource(&pdev->dev, res);
|
||||||
dev_err(&pdev->dev, "Couldn't ioremap at index 0\n");
|
if (IS_ERR(pmx->vbase))
|
||||||
return -ENODEV;
|
return PTR_ERR(pmx->vbase);
|
||||||
}
|
|
||||||
|
|
||||||
pmx->dev = &pdev->dev;
|
pmx->dev = &pdev->dev;
|
||||||
pmx->machdata = machdata;
|
pmx->machdata = machdata;
|
||||||
|
|
Loading…
Reference in New Issue