[PATCH v3 08/15] pinctrl: keembay: use a dedicated structure for the pinfunction description

Andy Shevchenko andy.shevchenko at gmail.com
Thu Jul 24 04:11:04 PDT 2025


On Thu, Jul 24, 2025 at 11:25 AM Bartosz Golaszewski <brgl at bgdev.pl> wrote:
>
> struct function_desc is a wrapper around struct pinfunction with an
> additional void *data pointer. We're 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().

Any link to the discussion and perhaps an updated in-kernel
documentation and/or TODO?

> This driver uses the data pointer so in
> order to stop using struct function_desc, we need to provide an
> alternative that also wraps the mux mode which is passed to pinctrl core
> as user data.

...

> +struct keembay_pinfunction {
> +       struct pinfunction func;
> +       u8 mux_mode;
> +};

My gut's feeling that this type of construction will be in tons of the
drivers, perhaps better to provide an alternative like
struct pinfunction_with_mode {
  ...
};

Or even with variadic arguments... (just saying)

-- 
With Best Regards,
Andy Shevchenko



More information about the linux-arm-kernel mailing list