On Thu, Jul 24, 2025 at 1:11 PM Andy Shevchenko <andy.shevchenko@xxxxxxxxx> wrote: > > On Thu, Jul 24, 2025 at 11:25 AM Bartosz Golaszewski <brgl@xxxxxxxx> 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? > The discussions happened under v1 and v2 of this series. The "reducing the usage ..." part refers to the need to avoid memory duplication of struct pinfunction really but it's a prerequisite. > > 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 { > ... Nah, literally only this one so far. And I bet we could rework it to avoid it altogether. Your proposal is too specific IMO. Let's cross that bridge when (if) we get there. > }; > > Or even with variadic arguments... (just saying) > Oh please no. :) Bartosz