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

Clément Le Goffic clegoffic at baylibre.com
Tue Nov 10 06:45:45 PST 2026


Hi Andy,

On 11/10/26 3:09 PM, Andy Shevchenko wrote:
> 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.

I'll try to be consistent in the v2

Best regards,
Clément



More information about the linux-arm-kernel mailing list