Skip to content

Commit

Permalink
pinctrl: imx: Convert to use func member
Browse files Browse the repository at this point in the history
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: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20240530085745.1539925-8-andy.shevchenko@gmail.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
  • Loading branch information
Andy Shevchenko authored and Linus Walleij committed Jun 17, 2024
1 parent 37997d7 commit f3e0473
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions drivers/pinctrl/freescale/pinctrl-imx.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ static int imx_pmx_set(struct pinctrl_dev *pctldev, unsigned selector,
npins = grp->grp.npins;

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++) {
/*
Expand Down Expand Up @@ -593,21 +593,21 @@ static int imx_pinctrl_parse_functions(struct device_node *np,
return -EINVAL;

/* Initialise function */
func->name = np->name;
func->num_group_names = of_get_child_count(np);
if (func->num_group_names == 0) {
func->func.name = np->name;
func->func.ngroups = of_get_child_count(np);
if (func->func.ngroups == 0) {
dev_info(ipctl->dev, "no groups defined in %pOF\n", np);
return -EINVAL;
}

group_names = devm_kcalloc(ipctl->dev, func->num_group_names,
sizeof(char *), GFP_KERNEL);
group_names = devm_kcalloc(ipctl->dev, func->func.ngroups,
sizeof(*func->func.groups), GFP_KERNEL);
if (!group_names)
return -ENOMEM;
i = 0;
for_each_child_of_node(np, child)
group_names[i++] = child->name;
func->group_names = group_names;
func->func.groups = group_names;

i = 0;
for_each_child_of_node(np, child) {
Expand Down

0 comments on commit f3e0473

Please sign in to comment.