From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8A8ADC433FE for ; Wed, 12 Oct 2022 11:10:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229646AbiJLLKr (ORCPT ); Wed, 12 Oct 2022 07:10:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47312 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229610AbiJLLKn (ORCPT ); Wed, 12 Oct 2022 07:10:43 -0400 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D4169A926A; Wed, 12 Oct 2022 04:10:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1665573042; x=1697109042; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=q7v71ZQ6SrTwwIFCLSZGjWB6QaC6SnhQ7675+Q8eeQw=; b=mmiwtnkgTXD1KCWWETqWuvuGBaBcjyZDeQ/0v3ASFyVNzwoCALJXh2XE 2SNl+QjU6JzHyLrktY6Sn8rhQRMqlY9BMQRFYB60WC9Ua+FcLxupwav3T IJZKySypD0eFk+dtSC+6VI+d8yG5Bg4OjENH4dXOjYJKW/GIO1/F4TiFz GzZju+vqgFZTK22ym8gSNbkSRgeMGz2yXUlhsfY7P9APRax2fKQo+gMVd QDL87MkZUB26XYgTQm0MhLS0OE5XrFJ7LmvUkHVJLVMPXL625HzLK7BNn BUxJiMTKXTEA0kS4T4jNUTzEQ6+j05dFG45/MPghNWrHuKIW700B1enQt g==; X-IronPort-AV: E=McAfee;i="6500,9779,10497"; a="288032305" X-IronPort-AV: E=Sophos;i="5.95,179,1661842800"; d="scan'208";a="288032305" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Oct 2022 04:10:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10497"; a="659892843" X-IronPort-AV: E=Sophos;i="5.95,179,1661842800"; d="scan'208";a="659892843" Received: from smile.fi.intel.com ([10.237.72.54]) by orsmga001.jf.intel.com with ESMTP; 12 Oct 2022 04:10:39 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1oiZdG-005nZ6-0q; Wed, 12 Oct 2022 14:10:38 +0300 Date: Wed, 12 Oct 2022 14:10:37 +0300 From: Andy Shevchenko To: Dmitry Torokhov Cc: Linus Walleij , Bartosz Golaszewski , Daniel Thompson , linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org Subject: Re: [PATCH 6/7] gpiolib: of: factor out code overriding gpio line polarity Message-ID: References: <20221011-gpiolib-quirks-v1-0-e01d9d3e7b29@gmail.com> <20221011-gpiolib-quirks-v1-6-e01d9d3e7b29@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221011-gpiolib-quirks-v1-6-e01d9d3e7b29@gmail.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org 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