pinctrl: keembay: rework loops looking for groups names
authorRafał Miłecki <rafal@milecki.pl>
Thu, 16 Dec 2021 16:22:05 +0000 (17:22 +0100)
committerLinus Walleij <linus.walleij@linaro.org>
Wed, 22 Dec 2021 01:57:27 +0000 (02:57 +0100)
commitc26c4bfc10401415b3a5c5a83b94095d7c425617
tree3bf1d7aae6d9aa0395981a5000dfda723154a4f1
parent5d0674999cc5caec72130ad8ff3a211d153bcef5
pinctrl: keembay: rework loops looking for groups names

Make the outer loop iterate over functions as that's the real subject.
This simplifies code (and reduces amount of lines of code) as allocating
memory for names doesn't require extra checks anymore.

While at it use local "group_names" variable. The plan for
"struct function_desc" is to make its "group_names" /double/ const. That
will allow drivers to use it with static const data.

This keembay "group_names" change is required to avoid:
drivers/pinctrl/pinctrl-keembay.c: In function 'keembay_add_functions':
drivers/pinctrl/pinctrl-keembay.c:1594:8: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
 1594 |    grp = func->group_names;
      |        ^

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Link: https://lore.kernel.org/r/20211216162206.8027-3-zajec5@gmail.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/pinctrl-keembay.c