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: airoha: 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.

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
17d4f2a9 77377744

+5 -10
+5 -10
drivers/pinctrl/mediatek/pinctrl-airoha.c
··· 35 35 36 36 #define PINCTRL_FUNC_DESC(id) \ 37 37 { \ 38 - .desc = { \ 39 - .func = { \ 40 - .name = #id, \ 41 - .groups = id##_groups, \ 42 - .ngroups = ARRAY_SIZE(id##_groups), \ 43 - } \ 44 - }, \ 38 + .desc = PINCTRL_PINFUNCTION(#id, id##_groups, \ 39 + ARRAY_SIZE(id##_groups)), \ 45 40 .groups = id##_func_group, \ 46 41 .group_size = ARRAY_SIZE(id##_func_group), \ 47 42 } ··· 329 334 }; 330 335 331 336 struct airoha_pinctrl_func { 332 - const struct function_desc desc; 337 + const struct pinfunction desc; 333 338 const struct airoha_pinctrl_func_group *groups; 334 339 u8 group_size; 335 340 }; ··· 2903 2908 2904 2909 func = &airoha_pinctrl_funcs[i]; 2905 2910 err = pinmux_generic_add_pinfunction(pinctrl->ctrl, 2906 - &func->desc.func, 2911 + &func->desc, 2907 2912 (void *)func); 2908 2913 if (err < 0) { 2909 2914 dev_err(dev, "Failed to register function %s\n", 2910 - func->desc.func.name); 2915 + func->desc.name); 2911 2916 return err; 2912 2917 } 2913 2918 }