Re: [PATCH 6/7] gpiolib: of: factor out code overriding gpio line polarity

From: Andy Shevchenko
Date: Wed Oct 12 2022 - 07:10:53 EST


On Tue, Oct 11, 2022 at 03:19:34PM -0700, Dmitry Torokhov wrote:
> There are several instances where we use a separate property to
> override polarity specified in gpio property. Factor it out into
> a separate function.

...

> static void of_gpio_flags_quirks(const struct device_node *np,
> const char *propname,
> enum of_gpio_flags *flags,
> @@ -145,7 +167,7 @@ static void of_gpio_flags_quirks(const struct device_node *np,
> (!(strcmp(propname, "enable-gpio") &&
> strcmp(propname, "enable-gpios")) &&
> of_device_is_compatible(np, "regulator-gpio")))) {
> - bool active_low = !of_property_read_bool(np,
> + bool active_high = of_property_read_bool(np,

Defining

bool active_high;

at the top of the function will save you a few ugly indented code lines here
and in the next patch.

--
With Best Regards,
Andy Shevchenko