Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp4035136pxb; Tue, 10 Nov 2020 06:29:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJySVoT6I/WXV6rDJrXYWC/NNgtGnfb36khhGP8sWi7X7ORHrIg6dn4MWuchdbPY2xu60rZC X-Received: by 2002:aa7:d703:: with SMTP id t3mr20398761edq.375.1605018541951; Tue, 10 Nov 2020 06:29:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605018541; cv=none; d=google.com; s=arc-20160816; b=e+8Jt0VldHH+CZ6NYaTOWnPwnwX/5oltGXOUstBCCVQofrn+CILIzeCX+YpCGa7/Mt X5+c6xWrPyBWIzfXGd8cHCsqqVGuGyBFUy4sB9Q1GXyLU8nTs6qQRoyDIqi9Pj/O1f9h fCDt8K/2exBq40plPFh5cHjTxCzdfu22lsvlcPQNNkYVzuNqXp79JBbIY/AS116bgmGN 49rLC3i4eMnF/ag6KD2b2mPLH84Cd4rX6zlJLLgYE7YqP/W4Visy5bptWG+pO4zDnCHj d/c4bRaxj9MaDPOwFwEkugExm7wrFBVJAyCV0N4SlwO30q4k7IvA/trwtnZYPD7RCan9 5C/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :ironport-sdr:ironport-sdr; bh=DxNHA/OdxlidxnyF39atAg37FgDjNCnsQf9VYOMmZBg=; b=WQ7pVEt16/31QIJVZC2SDgIf4VOdZ8HPQ9skaV4pmGpIjqXrQJ0PnYfSLVDjsfkvoF JOQV7ZYNk4xqyyxeJAbeFeRiBOfyprQHWpe4Z/VvEnkJoyipnN3BpdPJEiy/S7w2JJF0 klV//ryAmA9hkojp13i0XeToXUgrBSiDVAVWDidmnkPDjCSRFm/LIjyK6ER4/Ru9h7it vwOFByjV0XvrNJIwcuAByZKnU6uxRFkyjkDVzCdCdjUujZJow8tm+Ur+4Ncx8z7lWYTc iX3aDUzQkbOiZERYwmCa5yNy9CNz9bbyu0g6bVFXcGfyL+ZRMJSfxZYp+GSYyhugfy5z BVgA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d21si9690320edu.380.2020.11.10.06.28.38; Tue, 10 Nov 2020 06:29:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730524AbgKJO0v (ORCPT + 99 others); Tue, 10 Nov 2020 09:26:51 -0500 Received: from mga17.intel.com ([192.55.52.151]:27997 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730059AbgKJO0v (ORCPT ); Tue, 10 Nov 2020 09:26:51 -0500 IronPort-SDR: 2UpuuUnYgUkZJm1lIdtDtQI6Nc9VMCgtPWEGL+taI65/AbhHnx5hg+EpDkToZ63U1KJHeQIBrn 9VV2ZpRlRWKg== X-IronPort-AV: E=McAfee;i="6000,8403,9800"; a="149828648" X-IronPort-AV: E=Sophos;i="5.77,466,1596524400"; d="scan'208";a="149828648" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Nov 2020 06:26:51 -0800 IronPort-SDR: lxYSFEGxy4Km5kAA/xUqloobFP4zJ/MpiwZQwkbSbDDKz//CYOgtcl5OCQVvtX6NgEGVR/nGzO b/oc46MGYCbQ== X-IronPort-AV: E=Sophos;i="5.77,466,1596524400"; d="scan'208";a="531224571" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Nov 2020 06:26:48 -0800 Received: from andy by smile with local (Exim 4.94) (envelope-from ) id 1kcUcg-005UvP-VG; Tue, 10 Nov 2020 16:27:50 +0200 Date: Tue, 10 Nov 2020 16:27:50 +0200 From: Andy Shevchenko To: Bartosz Golaszewski Cc: Linus Walleij , Jan Kiszka , David Laight , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski Subject: Re: [PATCH v3 6/7] gpio: exar: switch to using regmap Message-ID: <20201110142750.GU4077@smile.fi.intel.com> References: <20201110123406.3261-1-brgl@bgdev.pl> <20201110123406.3261-7-brgl@bgdev.pl> <20201110142624.GT4077@smile.fi.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201110142624.GT4077@smile.fi.intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 10, 2020 at 04:26:24PM +0200, Andy Shevchenko wrote: > On Tue, Nov 10, 2020 at 01:34:05PM +0100, Bartosz Golaszewski wrote: > > From: Bartosz Golaszewski > > > > We can simplify the code in gpio-exar by using regmap. This allows us to > > drop the mutex (regmap provides its own locking) and we can also reuse > > regmap's bit operations instead of implementing our own update function. > > ... > > > + /* > > + * We don't need to check the return values of mmio regmap operations (unless > > + * the regmap has a clock attached which is not the case here). > > + */ > > + exar_gpio->regs = devm_regmap_init_mmio(dev, p, &exar_regmap_config); > > + if (IS_ERR(exar_gpio->regs)) > > + return PTR_ERR(exar_gpio->regs); > > > > index = ida_alloc(&ida_index, GFP_KERNEL); > > - if (index < 0) { > > - ret = index; > > - goto err_mutex_destroy; > > - } > > + if (index < 0) > > + return index; > > And below you effectively use p as regmap! > That's what renaming of variable regs -> regmap or map can easily reveal. > > exar_gpio->regs = p; Jan, if you remove this line, does it help? -- With Best Regards, Andy Shevchenko