Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

pinctrl: sprd: Move DT parsing before registering pinctrl device

It will be failed to select default or sleep state for pins hogged
by the pin controller device, since we hadn't parsed pins configuration
in device tree before registering the pin controller device. Thus
we should move the device tree parsing function before registering
the pin controller device.

Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

authored by

Baolin Wang and committed by
Linus Walleij
63e037bc ad335bee

+6 -7
+6 -7
drivers/pinctrl/sprd/pinctrl-sprd.c
··· 1059 1059 return ret; 1060 1060 } 1061 1061 1062 + ret = sprd_pinctrl_parse_dt(sprd_pctl); 1063 + if (ret) { 1064 + dev_err(&pdev->dev, "fail to parse dt properties\n"); 1065 + return ret; 1066 + } 1067 + 1062 1068 pin_desc = devm_kcalloc(&pdev->dev, 1063 1069 pinctrl_info->npins, 1064 1070 sizeof(struct pinctrl_pin_desc), ··· 1087 1081 if (IS_ERR(sprd_pctl->pctl)) { 1088 1082 dev_err(&pdev->dev, "could not register pinctrl driver\n"); 1089 1083 return PTR_ERR(sprd_pctl->pctl); 1090 - } 1091 - 1092 - ret = sprd_pinctrl_parse_dt(sprd_pctl); 1093 - if (ret) { 1094 - dev_err(&pdev->dev, "fail to parse dt properties\n"); 1095 - pinctrl_unregister(sprd_pctl->pctl); 1096 - return ret; 1097 1084 } 1098 1085 1099 1086 return 0;