Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

pinctrl: mediatek: moore: replace struct function_desc with struct pinfunction

struct function_desc is a wrapper around struct pinfunction with an
additional void *data pointer. This driver doesn't use the data pointer.
We're also working towards reducing the usage of struct function_desc in
pinctrl drivers - they should only be created by pinmux core and
accessed by drivers using pinmux_generic_get_function(). Replace the
struct function_desc objects in this driver with smaller struct
pinfunction instances.

Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
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>

authored by

Bartosz Golaszewski and committed by
Linus Walleij
bd6f4a91 7a24f1f5

+11 -16
+2 -4
drivers/pinctrl/mediatek/pinctrl-moore.c
··· 622 622 int i, err; 623 623 624 624 for (i = 0; i < hw->soc->nfuncs ; i++) { 625 - const struct function_desc *function = hw->soc->funcs + i; 626 - const struct pinfunction *func = &function->func; 625 + const struct pinfunction *func = hw->soc->funcs + i; 627 626 628 - err = pinmux_generic_add_pinfunction(hw->pctrl, func, 629 - function->data); 627 + err = pinmux_generic_add_pinfunction(hw->pctrl, func, NULL); 630 628 if (err < 0) { 631 629 dev_err(hw->dev, "Failed to register function %s\n", 632 630 func->name);
+2 -5
drivers/pinctrl/mediatek/pinctrl-moore.h
··· 43 43 .data = id##_funcs, \ 44 44 } 45 45 46 - #define PINCTRL_PIN_FUNCTION(_name_, id) \ 47 - { \ 48 - .func = PINCTRL_PINFUNCTION(_name_, id##_groups, ARRAY_SIZE(id##_groups)), \ 49 - .data = NULL, \ 50 - } 46 + #define PINCTRL_PIN_FUNCTION(_name_, id) \ 47 + PINCTRL_PINFUNCTION(_name_, id##_groups, ARRAY_SIZE(id##_groups)) 51 48 52 49 int mtk_moore_pinctrl_probe(struct platform_device *pdev, 53 50 const struct mtk_pin_soc *soc);
+1 -1
drivers/pinctrl/mediatek/pinctrl-mt7622.c
··· 822 822 "uart4_2_rts_cts",}; 823 823 static const char *mt7622_wdt_groups[] = { "watchdog", }; 824 824 825 - static const struct function_desc mt7622_functions[] = { 825 + static const struct pinfunction mt7622_functions[] = { 826 826 PINCTRL_PIN_FUNCTION("antsel", mt7622_antsel), 827 827 PINCTRL_PIN_FUNCTION("emmc", mt7622_emmc), 828 828 PINCTRL_PIN_FUNCTION("eth", mt7622_ethernet),
+1 -1
drivers/pinctrl/mediatek/pinctrl-mt7623.c
··· 1340 1340 "uart3_rts_cts", }; 1341 1341 static const char *mt7623_wdt_groups[] = { "watchdog_0", "watchdog_1", }; 1342 1342 1343 - static const struct function_desc mt7623_functions[] = { 1343 + static const struct pinfunction mt7623_functions[] = { 1344 1344 PINCTRL_PIN_FUNCTION("audck", mt7623_aud_clk), 1345 1345 PINCTRL_PIN_FUNCTION("disp", mt7623_disp_pwm), 1346 1346 PINCTRL_PIN_FUNCTION("eth", mt7623_ethernet),
+1 -1
drivers/pinctrl/mediatek/pinctrl-mt7629.c
··· 384 384 static const char *mt7629_wifi_groups[] = { "wf0_5g", "wf0_2g", }; 385 385 static const char *mt7629_flash_groups[] = { "snfi", "spi_nor" }; 386 386 387 - static const struct function_desc mt7629_functions[] = { 387 + static const struct pinfunction mt7629_functions[] = { 388 388 PINCTRL_PIN_FUNCTION("eth", mt7629_ethernet), 389 389 PINCTRL_PIN_FUNCTION("i2c", mt7629_i2c), 390 390 PINCTRL_PIN_FUNCTION("led", mt7629_led),
+1 -1
drivers/pinctrl/mediatek/pinctrl-mt7981.c
··· 977 977 "wf0_mode1", "wf0_mode3", "mt7531_int", }; 978 978 static const char *mt7981_ant_groups[] = { "ant_sel", }; 979 979 980 - static const struct function_desc mt7981_functions[] = { 980 + static const struct pinfunction mt7981_functions[] = { 981 981 PINCTRL_PIN_FUNCTION("wa_aice", mt7981_wa_aice), 982 982 PINCTRL_PIN_FUNCTION("dfd", mt7981_dfd), 983 983 PINCTRL_PIN_FUNCTION("jtag", mt7981_jtag),
+1 -1
drivers/pinctrl/mediatek/pinctrl-mt7986.c
··· 878 878 static const char *mt7986_wdt_groups[] = { "watchdog", }; 879 879 static const char *mt7986_wf_groups[] = { "wf_2g", "wf_5g", "wf_dbdc", }; 880 880 881 - static const struct function_desc mt7986_functions[] = { 881 + static const struct pinfunction mt7986_functions[] = { 882 882 PINCTRL_PIN_FUNCTION("audio", mt7986_audio), 883 883 PINCTRL_PIN_FUNCTION("emmc", mt7986_emmc), 884 884 PINCTRL_PIN_FUNCTION("eth", mt7986_ethernet),
+1 -1
drivers/pinctrl/mediatek/pinctrl-mt7988.c
··· 1464 1464 "drv_vbus_p1", 1465 1465 }; 1466 1466 1467 - static const struct function_desc mt7988_functions[] = { 1467 + static const struct pinfunction mt7988_functions[] = { 1468 1468 PINCTRL_PIN_FUNCTION("audio", mt7988_audio), 1469 1469 PINCTRL_PIN_FUNCTION("jtag", mt7988_jtag), 1470 1470 PINCTRL_PIN_FUNCTION("int_usxgmii", mt7988_int_usxgmii),
+1 -1
drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.h
··· 238 238 unsigned int npins; 239 239 const struct group_desc *grps; 240 240 unsigned int ngrps; 241 - const struct function_desc *funcs; 241 + const struct pinfunction *funcs; 242 242 unsigned int nfuncs; 243 243 const struct mtk_eint_regs *eint_regs; 244 244 const struct mtk_eint_hw *eint_hw;