[PATCH v4 03/15] pinctrl: airoha: replace struct function_desc with struct pinfunction

Bartosz Golaszewski brgl at bgdev.pl
Thu Aug 14 00:37:39 PDT 2025


On Wed, 13 Aug 2025 18:57:00 +0200, Andy Shevchenko
<andy.shevchenko at gmail.com> said:
> On Tue, Aug 12, 2025 at 10:27 AM Bartosz Golaszewski <brgl at bgdev.pl> wrote:
>>
>> From: Bartosz Golaszewski <bartosz.golaszewski at linaro.org>
>>
>> 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.
>
> ...
>
>>  #define PINCTRL_FUNC_DESC(id)                                          \
>>         {                                                               \
>>                 .desc = {                                               \
>> -                       .func = {                                       \
>> -                               .name = #id,                            \
>> -                               .groups = id##_groups,                  \
>> -                               .ngroups = ARRAY_SIZE(id##_groups),     \
>> -                       }                                               \
>> +                       .name = #id,                                    \
>> +                       .groups = id##_groups,                          \
>> +                       .ngroups = ARRAY_SIZE(id##_groups),             \
>
> Can this use PINCTRL_PINFUNCITON() ?
>

Yes, it can. I'll update v5.

Bart

>>                 },                                                      \
>>                 .groups = id##_func_group,                              \
>>                 .group_size = ARRAY_SIZE(id##_func_group),              \
>
>>  };
>
> --
> With Best Regards,
> Andy Shevchenko
>



More information about the Linux-mediatek mailing list