]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
pinctrl: imx: Convert to use func member
authorAndy Shevchenko <andy.shevchenko@gmail.com>
Thu, 30 May 2024 08:55:16 +0000 (11:55 +0300)
committerLinus Walleij <linus.walleij@linaro.org>
Mon, 17 Jun 2024 07:24:30 +0000 (09:24 +0200)
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>
drivers/pinctrl/freescale/pinctrl-imx.c

index 2d3d80921c0d1b14afc934d3296efbbb8f591005..1ccdeb86d8a7a7eabfdda750fee42e129e6fa911 100644 (file)
@@ -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) {