Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp4038407pxb; Tue, 10 Nov 2020 06:33:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJxK9TPJu9zc4JtLeLpsWdwfu391PsADgsAuEZU1Nj5L63nV1kWgy4iWZZPpBFomOZjBy3bC X-Received: by 2002:a17:906:b783:: with SMTP id dt3mr20321574ejb.534.1605018804852; Tue, 10 Nov 2020 06:33:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605018804; cv=none; d=google.com; s=arc-20160816; b=PRZE+LdQZQQmxvBhMstSTgkUZEzz5GX4ek+UkKWZC/hrFZq6bgI8ShdJu5KjuBAfdk mF4FCu5y3x3NPBUJQgmhrE6b4jvE+pxfOHr61wND8PsCTBILSmKQ1nALFIy8Yz3WZGRD E/leuuDdQSeXFj+BBqJ857p9misEBnSDnSNz0Ur89h7ut8At6SgPQdzRUAOZM4bz/GNa jQ7kpGVhGiGsRwKiGyxmiecOP8xr9+jPpE9je/rfLpK/K0FIOlnMIo60NMM7ysPUIbKb hLt9ILH1WCms516b/Q5Q6QOtCk/FGQTYl+mtLw3al+BcOLKdyDfjbv5Vi4pS2Fne2LuK tFDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=9UIQJmL6CczJN1YVw46FpLH86rortdNWMolvQmvlA0w=; b=t7mmPuIeYA0NFk/FdCqeURplMxYnhxb7AF7tGOOzwDKRDOHMeRbUFJ9ry8iNpltaRp BSP5wpj/sVx4VbEdzcIR9a2swvpkuXMVhsuSbRU2djGvLyi93b3DjPFKDI22sRlsTi/k 3AP38aL1LJnlPmSz6hw7ZGvNg1cj860/Egvb6Ut4V2CCj9rUpg1Us8kMx7DH0buGmaHL AYr55lcMmkUlwNMwOj+jVCHHLaqbRyYI0I/PKxKGUNasUsUvQs64vxezu7fr3VSpRMnz fXrA5fQGgxyRLnHrL2TddQ1UxtBz5ZiZclB9Ijfc5PIXxo1ruybH1xyH8euz72pcruIa A1UA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=Nkf0L0dA; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v11si9006530ejx.648.2020.11.10.06.33.00; Tue, 10 Nov 2020 06:33:24 -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; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=Nkf0L0dA; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730666AbgKJOaZ (ORCPT + 99 others); Tue, 10 Nov 2020 09:30:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60774 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730070AbgKJOaZ (ORCPT ); Tue, 10 Nov 2020 09:30:25 -0500 Received: from mail-ed1-x541.google.com (mail-ed1-x541.google.com [IPv6:2a00:1450:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6AD8FC0613D1 for ; Tue, 10 Nov 2020 06:30:23 -0800 (PST) Received: by mail-ed1-x541.google.com with SMTP id t11so12889061edj.13 for ; Tue, 10 Nov 2020 06:30:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=9UIQJmL6CczJN1YVw46FpLH86rortdNWMolvQmvlA0w=; b=Nkf0L0dAG4Pd2L2ZUyEuEzLkoXrXSEwkYNAeeyVifS3VQCjRF5fUejF+TVuxZ/Rcen KdNe0TudgmM4epxXQDbhPupra6eTM8pt4qqJtU/k4ekQugs0YCtCB7dijJMsIvUZZJBZ SJevEiBW5nTC6/F5rZ5FD5+6QfoUJ/PHK5fHvtKG2S40SdrEG5j72qMBSdfQssS604Nx UdNac0knHgVxwEaxcTZfo9UL1iwz2tPLus6WyeDc40yHiaaIxw0uwXVGBs8uh5KGyAfg P9QKfAdm+vGWyjVDQw3WRD4pyJCvcbs/hX7MGXZEGClwqZNoLYck9Z2M8NRf0FWyulkG lT4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=9UIQJmL6CczJN1YVw46FpLH86rortdNWMolvQmvlA0w=; b=gltrTxSFWLZXM+0L6WhTYBYQICbgOhnAabCOH2F9ym2u1e6SWQQRiQMI/nCFwb2ITg 83en6zAerzMpa08jTbN3WDQo0EsJSC+MHAV17lGx9QcIUERHHnvZ96A3cRqBOhP1Mtdi LBAgFImTtSYOmoOa6Nrw7/nNptoKVSSiFGPDofa8FIN5jpdADsV3ntLRHFC6yKR4K1oe DR9vibZXRL4xeRFAUx8NQFJsRqCYxuoEhbMVsFS9gjriqU12xfVoOIjIY4kYV2CWP3JT mgwRjvgoVIFKcrCFb5e7fxZCIz+SDix0gNSyEvB/w2nrQLSyq3f5FjYrugTm/e0jYsDo w63Q== X-Gm-Message-State: AOAM533vqhgNXpXR23XU4sh99Fg679bDMAA0GK7QUDJK5nWgfixDOApA fJC7rdl74aIoEWbep5DXptzkR3EmzPR/qNuqMg16eg== X-Received: by 2002:a50:ab15:: with SMTP id s21mr21074123edc.88.1605018621972; Tue, 10 Nov 2020 06:30:21 -0800 (PST) MIME-Version: 1.0 References: <20201110123406.3261-1-brgl@bgdev.pl> <20201110123406.3261-7-brgl@bgdev.pl> <20201110142624.GT4077@smile.fi.intel.com> <20201110142750.GU4077@smile.fi.intel.com> In-Reply-To: <20201110142750.GU4077@smile.fi.intel.com> From: Bartosz Golaszewski Date: Tue, 10 Nov 2020 15:30:10 +0100 Message-ID: Subject: Re: [PATCH v3 6/7] gpio: exar: switch to using regmap To: Andy Shevchenko Cc: Bartosz Golaszewski , Linus Walleij , Jan Kiszka , David Laight , linux-gpio , LKML Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 10, 2020 at 3:26 PM Andy Shevchenko wrote: > > 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? > Ha! I guess you were right saying that keeping the name is asking for trouble then. :) I think that may be it but address width should still be changed to 16. Bartosz