pinctrl: make struct pinfunction a pointer in struct function_desc
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Tue, 2 Sep 2025 11:59:20 +0000 (13:59 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Mon, 8 Sep 2025 12:22:41 +0000 (14:22 +0200)
commitd57b7979ea4c43655e8772b91cbac0f613419f4a
tree914fcc66b6dfb460556b5856d8e90f2f3977dbed
parentfbba4a9e368f6ec521043ae4035edb2b74ed12e4
pinctrl: make struct pinfunction a pointer in struct function_desc

We currently duplicate the entire struct pinfunction object in
pinmux_generic_add_pinfunction(). While this is inevitable when the
arguments come in split through pinmux_generic_add_function(), users of
pinmux_generic_add_pinfunction() will typically pass addresses of
structures in .rodata, meaning we can try to avoid the duplication with
the help from kmemdup_const(). To that end: don't wrap the entire struct
pinfunction in struct function_desc but rather just store the address.

Tested-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/freescale/pinctrl-imx.c
drivers/pinctrl/mediatek/pinctrl-airoha.c
drivers/pinctrl/mediatek/pinctrl-moore.c
drivers/pinctrl/pinctrl-ingenic.c
drivers/pinctrl/pinmux.c
drivers/pinctrl/pinmux.h