summaryrefslogtreecommitdiffstats
path: root/kernel/drivers/pinctrl/freescale/pinctrl-imx1-core.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/drivers/pinctrl/freescale/pinctrl-imx1-core.c')
-rw-r--r--kernel/drivers/pinctrl/freescale/pinctrl-imx1-core.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/kernel/drivers/pinctrl/freescale/pinctrl-imx1-core.c b/kernel/drivers/pinctrl/freescale/pinctrl-imx1-core.c
index d3a3be747..acaf84cad 100644
--- a/kernel/drivers/pinctrl/freescale/pinctrl-imx1-core.c
+++ b/kernel/drivers/pinctrl/freescale/pinctrl-imx1-core.c
@@ -538,8 +538,10 @@ static int imx1_pinctrl_parse_functions(struct device_node *np,
func->groups[i] = child->name;
grp = &info->groups[grp_index++];
ret = imx1_pinctrl_parse_groups(child, grp, info, i++);
- if (ret == -ENOMEM)
+ if (ret == -ENOMEM) {
+ of_node_put(child);
return ret;
+ }
}
return 0;
@@ -582,8 +584,10 @@ static int imx1_pinctrl_parse_dt(struct platform_device *pdev,
for_each_child_of_node(np, child) {
ret = imx1_pinctrl_parse_functions(child, info, ifunc++);
- if (ret == -ENOMEM)
+ if (ret == -ENOMEM) {
+ of_node_put(child);
return -ENOMEM;
+ }
}
return 0;
@@ -632,9 +636,9 @@ int imx1_pinctrl_core_probe(struct platform_device *pdev,
ipctl->dev = info->dev;
platform_set_drvdata(pdev, ipctl);
ipctl->pctl = pinctrl_register(pctl_desc, &pdev->dev, ipctl);
- if (!ipctl->pctl) {
+ if (IS_ERR(ipctl->pctl)) {
dev_err(&pdev->dev, "could not register IMX pinctrl driver\n");
- return -EINVAL;
+ return PTR_ERR(ipctl->pctl);
}
ret = of_platform_populate(pdev->dev.of_node, NULL, NULL, &pdev->dev);