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

pinctrl: ingenic: 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-9-andy.shevchenko@gmail.comSigned-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent f3e0473a
...@@ -96,9 +96,7 @@ ...@@ -96,9 +96,7 @@
#define INGENIC_PIN_FUNCTION(_name_, id) \ #define INGENIC_PIN_FUNCTION(_name_, id) \
{ \ { \
.name = _name_, \ .func = PINCTRL_PINFUNCTION(_name_, id##_groups, ARRAY_SIZE(id##_groups)), \
.group_names = id##_groups, \
.num_group_names = ARRAY_SIZE(id##_groups), \
.data = NULL, \ .data = NULL, \
} }
...@@ -3769,7 +3767,7 @@ static int ingenic_pinmux_set_mux(struct pinctrl_dev *pctldev, ...@@ -3769,7 +3767,7 @@ static int ingenic_pinmux_set_mux(struct pinctrl_dev *pctldev,
return -EINVAL; return -EINVAL;
dev_dbg(pctldev->dev, "enable function %s group %s\n", dev_dbg(pctldev->dev, "enable function %s group %s\n",
func->name, grp->grp.name); func->func.name, grp->grp.name);
mode = (uintptr_t)grp->data; mode = (uintptr_t)grp->data;
if (mode <= 3) { if (mode <= 3) {
...@@ -4317,14 +4315,14 @@ static int __init ingenic_pinctrl_probe(struct platform_device *pdev) ...@@ -4317,14 +4315,14 @@ static int __init ingenic_pinctrl_probe(struct platform_device *pdev)
} }
for (i = 0; i < chip_info->num_functions; i++) { for (i = 0; i < chip_info->num_functions; i++) {
const struct function_desc *func = &chip_info->functions[i]; const struct function_desc *function = &chip_info->functions[i];
const struct pinfunction *func = &function->func;
err = pinmux_generic_add_function(jzpc->pctl, func->name, err = pinmux_generic_add_function(jzpc->pctl, func->name,
func->group_names, func->num_group_names, func->groups, func->ngroups,
func->data); function->data);
if (err < 0) { if (err < 0) {
dev_err(dev, "Failed to register function %s\n", dev_err(dev, "Failed to register function %s\n", func->name);
func->name);
return err; return err;
} }
} }
......
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