Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp1595140ybm; Sat, 30 May 2020 14:09:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzWEMapPTZiFmvLRH82KM25b7kaoRz8RCu7RFBB1fPOryY5AvlNY0XF77nBPB+LGaQVc7Kq X-Received: by 2002:a50:e44d:: with SMTP id e13mr14125413edm.373.1590872958542; Sat, 30 May 2020 14:09:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590872958; cv=none; d=google.com; s=arc-20160816; b=oDY/g8o11tvdizDw7cTmvTtoLDNHqGqpEJq14s9Q2UVPJbmvpp+0IOiM8guD4Fl5kj zU3QHk4LUuv8rwQH5JSSqqNFPcNu24VbQzbT8Ju/ZKwhxrj8cGgWLE0aeUYSBPKEkwua rYqh/N6Yw8hefGP6zHLGIL4OAggB6w5VBSfC+1Rxt8PhC4yNLU1S2G/cQ7q3G3VOs0rc BUmMPj1zImD1bUjSV7eoDE1Ukpfw1O1VDdkSefR66fzPFXI16pVEYZBXPf9HvpZICADk N0bmT2mI0IL2R/XsASMaUe4S3hqofy3CpznW3YqqY0LVJ6HyOFXo0ociqFJc/Sq2CPBK fSKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=jz/WMNBVtZF/AW2+hsve4FtnC7/7Ci/GmtOZcSbvHNc=; b=xaZgBq2K2EeRULZcv/Vt4Lt5FIytEG5vFGunoh+sKFor3iGioqq7zm4YGzjtZhohwd 4z+5KXveLvGmursdqwL9kzM6MMlKaaaiWA8J/gbQycG5BPbg2gjrUk24indcOk0a1zt1 1dShuq/5infWUITf2UjziEAfyl8ro0dr8bzG1MlodJ05mF5XT6u3DxiiacYoqWo7ihUz TbD6Zz2W8IQxywgGaavA6Ljcaya81sMfY9cL+MfRsS3rLgn9E/ufwXIAe7Svs+ezckCI mo+d+KyYENyA49/Syy3SII3AQh6VecvHzp9FakWQktB++YozralDxpsYjnu61IbXMZAw gfhw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h27si8206940ejs.754.2020.05.30.14.08.44; Sat, 30 May 2020 14:09:18 -0700 (PDT) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729338AbgE3VF6 (ORCPT + 99 others); Sat, 30 May 2020 17:05:58 -0400 Received: from sauhun.de ([88.99.104.3]:37032 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728741AbgE3VF5 (ORCPT ); Sat, 30 May 2020 17:05:57 -0400 Received: from localhost (p5486c6a9.dip0.t-ipconnect.de [84.134.198.169]) by pokefinder.org (Postfix) with ESMTPSA id B79692C206B; Sat, 30 May 2020 23:05:54 +0200 (CEST) Date: Sat, 30 May 2020 23:05:54 +0200 From: Wolfram Sang To: Serge Semin Cc: Jarkko Nikula , Andy Shevchenko , Mika Westerberg , Serge Semin , Alexey Malahov , Thomas Bogendoerfer , Rob Herring , devicetree@vger.kernel.org, linux-mips@vger.kernel.org, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v6 08/11] i2c: designware: Convert driver to using regmap API Message-ID: <20200530210554.GA15682@ninjato> References: <20200528093322.23553-1-Sergey.Semin@baikalelectronics.ru> <20200528093322.23553-9-Sergey.Semin@baikalelectronics.ru> <20200530110930.GC1038@ninjato> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="a8Wt8u1KmwUX3Y2C" Content-Disposition: inline In-Reply-To: <20200530110930.GC1038@ninjato> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --a8Wt8u1KmwUX3Y2C Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, May 30, 2020 at 01:09:30PM +0200, Wolfram Sang wrote: > On Thu, May 28, 2020 at 12:33:18PM +0300, Serge Semin wrote: > > Seeing the DW I2C driver is using flags-based accessors with two > > conditional clauses it would be better to replace them with the regmap > > API IO methods and to initialize the regmap object with read/write > > callbacks specific to the controller registers map implementation. This > > will be also handy for the drivers with non-standard registers mapping > > (like an embedded into the Baikal-T1 System Controller DW I2C block, wh= ich > > glue-driver is a part of this series). > >=20 > > As before the driver tries to detect the mapping setup at probe stage a= nd > > creates a regmap object accordingly, which will be used by the rest of = the > > code to correctly access the controller registers. In two places it was > > appropriate to convert the hand-written read-modify-write and > > read-poll-loop design patterns to the corresponding regmap API > > ready-to-use methods. > >=20 > > Note the regmap IO methods return value is checked only at the probe > > stage. The rest of the code won't do this because basically we have > > MMIO-based regmap so non of the read/write methods can fail (this also > > won't be needed for the Baikal-T1-specific I2C controller). > >=20 > > Suggested-by: Andy Shevchenko > > Signed-off-by: Serge Semin > > Tested-by: Jarkko Nikula > > Acked-by: Jarkko Nikula > > Cc: Alexey Malahov > > Cc: Thomas Bogendoerfer > > Cc: Rob Herring > > Cc: devicetree@vger.kernel.org > > Cc: linux-mips@vger.kernel.org >=20 > My codecheckers found these, rightfully I'd say: >=20 > SPARSE > drivers/i2c/busses/i2c-designware-master.c:427:53: warning: incorrect typ= e in argument 3 (different signedness) > drivers/i2c/busses/i2c-designware-master.c:427:53: expected unsigned i= nt *val > drivers/i2c/busses/i2c-designware-master.c:427:53: got int * >=20 > CC > drivers/i2c/busses/i2c-designware-common.c:127: warning: Excess function = parameter 'base' description in 'i2c_dw_init_regmap' >=20 > ^ means there is an argument documented which does not exist in the > function declaration Well, I fixed these two minor things for your now... --a8Wt8u1KmwUX3Y2C Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEOZGx6rniZ1Gk92RdFA3kzBSgKbYFAl7Syq4ACgkQFA3kzBSg KbY0gQ//YKOc7BeIxNJoEgL1mTbEvdfy6VyzbzoS8K4/J/XOSLeftwBr6tSTUNVQ 37AcCaqImPPbzUz3EOL9mkfyduGNeVlY+BomsSqABB3SzamwSzo5GajCb64zizjj PlrA2ki7SjHINrO3vIIvsxMyU9gqVUR2v8ImRmnNPVm2qzmbRs+/IfnokRxbwZwT CHefaToS6go4dCGuCCA5MXPbWlI66j1YH59sewh6IxI/eH6gi/vRdFrJIzhlnyef TqHGLeypN0rewdrv1jgr53UF/pInKr9k8XC4xM35TZXjfh5FaQTgfXS2q35c1wYi 72Cm30DLz9m6YBWEksiCBPUl22oJY3uN//W7SE+d78B1Y5rgszbU47xB7DAXEtUx uEzSVx/yUVobrfwuJn5BQHJRS18uQOl6I61X31qE5VFkDqaRJNjAX2E7+XhaQVSr wqGzm9AnFmCmNHbanNjW4EnzObW8mq23LXLAWJbWurpEIFL3HinktUN0JliSBysv AV67nD+0H0nBSBYul6aEi5EWgK+b4PyvaW/GEC1mGzT0jwxqiP+585SGIAGlMcLd 8CeXJo0aPPlvGoZZxR1SXv7qlsyuJVIy3PauXfyZf/obw0+wkFZ2Gl5oyaKOGGTA a7yvUdM9AFaJ2zzgO4Y+cmOFpg47PIZ54nhyKwAOmD3iGSyx/HI= =PIEk -----END PGP SIGNATURE----- --a8Wt8u1KmwUX3Y2C--