pinctrl: thunderbay: rework loops looking for groups names
authorRafał Miłecki <rafal@milecki.pl>
Tue, 11 Jan 2022 17:29:19 +0000 (18:29 +0100)
committerLinus Walleij <linus.walleij@linaro.org>
Sun, 16 Jan 2022 00:52:09 +0000 (01:52 +0100)
commitbe973481daaab7b6549631ea79571532794aedf1
tree5480956bd1a1e45dd508674eb2d20f714c152a77
parent8687999e47d4dd32ad506c72d0d4f4d7e2f788b9
pinctrl: thunderbay: 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. It fixes:
drivers/pinctrl/pinctrl-thunderbay.c: In function 'thunderbay_add_functions':
drivers/pinctrl/pinctrl-thunderbay.c:815:8: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  815 |    grp = func->group_names;
      |        ^

Ref: c26c4bfc1040 ("pinctrl: keembay: rework loops looking for groups names")
Reported-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Link: https://lore.kernel.org/r/20220111172919.6567-2-zajec5@gmail.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/pinctrl-thunderbay.c