Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 65D99CA9EAF for ; Mon, 21 Oct 2019 12:27:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 41E4220B7C for ; Mon, 21 Oct 2019 12:27:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728098AbfJUM1Y (ORCPT ); Mon, 21 Oct 2019 08:27:24 -0400 Received: from mga18.intel.com ([134.134.136.126]:6381 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727685AbfJUM1Y (ORCPT ); Mon, 21 Oct 2019 08:27:24 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Oct 2019 05:27:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,323,1566889200"; d="scan'208";a="209434512" Received: from lahna.fi.intel.com (HELO lahna) ([10.237.72.157]) by fmsmga001.fm.intel.com with SMTP; 21 Oct 2019 05:27:20 -0700 Received: by lahna (sSMTP sendmail emulation); Mon, 21 Oct 2019 15:27:20 +0300 Date: Mon, 21 Oct 2019 15:27:20 +0300 From: Mika Westerberg To: Andy Shevchenko Cc: Linus Walleij , linux-gpio@vger.kernel.org Subject: Re: [PATCH v1 3/3] pinctrl: intel: Introduce intel_restore_intmask() helper Message-ID: <20191021122720.GE2819@lahna.fi.intel.com> References: <20191014084348.42489-1-andriy.shevchenko@linux.intel.com> <20191014084348.42489-3-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191014084348.42489-3-andriy.shevchenko@linux.intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org On Mon, Oct 14, 2019 at 11:43:48AM +0300, Andy Shevchenko wrote: > Refactor restoring GPI_IE registers by using an introduced helper. > > Signed-off-by: Andy Shevchenko > --- > drivers/pinctrl/intel/pinctrl-intel.c | 16 +++++++++++----- > 1 file changed, 11 insertions(+), 5 deletions(-) > > diff --git a/drivers/pinctrl/intel/pinctrl-intel.c b/drivers/pinctrl/intel/pinctrl-intel.c > index e59ac31921e7..b9df243e19cf 100644 > --- a/drivers/pinctrl/intel/pinctrl-intel.c > +++ b/drivers/pinctrl/intel/pinctrl-intel.c > @@ -1607,6 +1607,15 @@ static void intel_restore_hostown(struct intel_pinctrl *pctrl, unsigned int c, > dev_warn(dev, "restored hostown %u/%u %#8x->%#8x\n", c, gpp, value, saved); > } > > +static void intel_restore_intmask(struct intel_pinctrl *pctrl, unsigned int c, > + void __iomem *base, unsigned int gpp, u32 saved) > +{ > + struct device *dev = pctrl->dev; const? Also should we do the same here as we do with others and check first whether we need to update the mask at all?