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

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.com


Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 37997d7b
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -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) {