mirror of
https://github.com/torvalds/linux.git
synced 2026-05-31 02:24:24 +02:00
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: 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>
This commit is contained in:
parent
37997d7b55
commit
f3e0473aa8
|
|
@ -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++) {
|
||||
/*
|
||||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user