Commit 6273a1b1 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Linus Walleij

pinctrl: mediatek: moore: 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.
Reviewed-by: default avatarAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20240530085745.1539925-11-andy.shevchenko@gmail.comSigned-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent ab8866c5
...@@ -56,7 +56,7 @@ static int mtk_pinmux_set_mux(struct pinctrl_dev *pctldev, ...@@ -56,7 +56,7 @@ static int mtk_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);
for (i = 0; i < grp->grp.npins; i++) { for (i = 0; i < grp->grp.npins; i++) {
const struct mtk_pin_desc *desc; const struct mtk_pin_desc *desc;
...@@ -620,12 +620,12 @@ static int mtk_build_functions(struct mtk_pinctrl *hw) ...@@ -620,12 +620,12 @@ static int mtk_build_functions(struct mtk_pinctrl *hw)
int i, err; int i, err;
for (i = 0; i < hw->soc->nfuncs ; i++) { for (i = 0; i < hw->soc->nfuncs ; i++) {
const struct function_desc *func = hw->soc->funcs + i; const struct function_desc *function = hw->soc->funcs + i;
const struct pinfunction *func = &function->func;
err = pinmux_generic_add_function(hw->pctrl, func->name, err = pinmux_generic_add_function(hw->pctrl, func->name,
func->group_names, func->groups, func->ngroups,
func->num_group_names, function->data);
func->data);
if (err < 0) { if (err < 0) {
dev_err(hw->dev, "Failed to register function %s\n", dev_err(hw->dev, "Failed to register function %s\n",
func->name); func->name);
......
...@@ -45,9 +45,7 @@ ...@@ -45,9 +45,7 @@
#define PINCTRL_PIN_FUNCTION(_name_, id) \ #define PINCTRL_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, \
} }
......
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