Commit f3e0473a authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Linus Walleij

pinctrl: imx: Convert to use func member

Convert drivers to use func member embedded in struct function_desc,
because other members will be removed to avoid duplication and
desynchronisation of the generic pin function description.
Signed-off-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20240530085745.1539925-8-andy.shevchenko@gmail.comSigned-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 37997d7b
...@@ -266,7 +266,7 @@ static int imx_pmx_set(struct pinctrl_dev *pctldev, unsigned selector, ...@@ -266,7 +266,7 @@ static int imx_pmx_set(struct pinctrl_dev *pctldev, unsigned selector,
npins = grp->grp.npins; npins = grp->grp.npins;
dev_dbg(ipctl->dev, "enable function %s group %s\n", dev_dbg(ipctl->dev, "enable function %s group %s\n",
func->name, grp->grp.name); func->func.name, grp->grp.name);
for (i = 0; i < npins; i++) { for (i = 0; i < npins; i++) {
/* /*
...@@ -593,21 +593,21 @@ static int imx_pinctrl_parse_functions(struct device_node *np, ...@@ -593,21 +593,21 @@ static int imx_pinctrl_parse_functions(struct device_node *np,
return -EINVAL; return -EINVAL;
/* Initialise function */ /* Initialise function */
func->name = np->name; func->func.name = np->name;
func->num_group_names = of_get_child_count(np); func->func.ngroups = of_get_child_count(np);
if (func->num_group_names == 0) { if (func->func.ngroups == 0) {
dev_info(ipctl->dev, "no groups defined in %pOF\n", np); dev_info(ipctl->dev, "no groups defined in %pOF\n", np);
return -EINVAL; return -EINVAL;
} }
group_names = devm_kcalloc(ipctl->dev, func->num_group_names, group_names = devm_kcalloc(ipctl->dev, func->func.ngroups,
sizeof(char *), GFP_KERNEL); sizeof(*func->func.groups), GFP_KERNEL);
if (!group_names) if (!group_names)
return -ENOMEM; return -ENOMEM;
i = 0; i = 0;
for_each_child_of_node(np, child) for_each_child_of_node(np, child)
group_names[i++] = child->name; group_names[i++] = child->name;
func->group_names = group_names; func->func.groups = group_names;
i = 0; i = 0;
for_each_child_of_node(np, child) { for_each_child_of_node(np, child) {
......
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