[PATCH 11/11] pinctrl: scmi: select the GPIO function on GPIO requests

Andy Shevchenko andriy.shevchenko at intel.com
Tue Nov 10 06:09:49 PST 2026


On Tue, Nov 10, 2026 at 01:49:25PM +0000, Cristian Marussi wrote:
> On Fri, Oct 30, 2026 at 04:58:42PM +0100, Clément Le Goffic wrote:

...

> > +static int pinctrl_scmi_gpio_mux_set(struct scmi_pinctrl *pmx, unsigned int pin)
> > +{
> > +	const unsigned int *elems, *pins;
> > +	unsigned int nr_elems, nr_pins, i;
> > +	bool pin_only, gpio;
> > +	int nr_functions, func, ret;

> Beside nr_functions, cannot all of these variable definitions be moved
> inside the scope in which they are exclusively used, i.e. down inside
> the for-loop ?

While it can be done, it's not most recommended style. Is it already in use in
this driver elsewhere? If not, don't do it in a single function. Same if it's
used in like one or two out of dozens of cases. TL;DR: be consistent in the
first place.

-- 
With Best Regards,
Andy Shevchenko





More information about the linux-arm-kernel mailing list