Commit f9819739 authored by Thomas Abraham's avatar Thomas Abraham Committed by Linus Walleij

pinctrl: exynos5440: fix probe failure due to missing pin-list in config nodes

The property 'samsung,exynos5440-pins' is optional in configuration nodes
which are included in the Exynos5440 pin-controller device node. Fix the
incorrect failure in driver probe if 'samsung,exynos5440-pins' property
is not found in the configuration nodes.
Signed-off-by: default avatarThomas Abraham <thomas.ab@samsung.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarKukjin Kim <kgene.kim@samsung.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 2e8ff91a
...@@ -670,8 +670,10 @@ static int exynos5440_pinctrl_parse_dt(struct platform_device *pdev, ...@@ -670,8 +670,10 @@ static int exynos5440_pinctrl_parse_dt(struct platform_device *pdev,
ret = exynos5440_pinctrl_parse_dt_pins(pdev, cfg_np, ret = exynos5440_pinctrl_parse_dt_pins(pdev, cfg_np,
&pin_list, &npins); &pin_list, &npins);
if (ret) if (ret) {
return ret; gname = NULL;
goto skip_to_pin_function;
}
/* derive pin group name from the node name */ /* derive pin group name from the node name */
gname = devm_kzalloc(dev, strlen(cfg_np->name) + GSUFFIX_LEN, gname = devm_kzalloc(dev, strlen(cfg_np->name) + GSUFFIX_LEN,
...@@ -687,6 +689,7 @@ static int exynos5440_pinctrl_parse_dt(struct platform_device *pdev, ...@@ -687,6 +689,7 @@ static int exynos5440_pinctrl_parse_dt(struct platform_device *pdev,
grp->num_pins = npins; grp->num_pins = npins;
grp++; grp++;
skip_to_pin_function:
ret = of_property_read_u32(cfg_np, "samsung,exynos5440-pin-function", ret = of_property_read_u32(cfg_np, "samsung,exynos5440-pin-function",
&function); &function);
if (ret) if (ret)
...@@ -709,7 +712,7 @@ static int exynos5440_pinctrl_parse_dt(struct platform_device *pdev, ...@@ -709,7 +712,7 @@ static int exynos5440_pinctrl_parse_dt(struct platform_device *pdev,
return -ENOMEM; return -ENOMEM;
} }
func->groups[0] = gname; func->groups[0] = gname;
func->num_groups = 1; func->num_groups = gname ? 1 : 0;
func->function = function; func->function = function;
func++; func++;
func_idx++; func_idx++;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment