Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp2153004ybm; Sun, 31 May 2020 10:16:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxKhjcGZRWibDf3h/ice5o8tzOnLvoHn2z5+UNnJUSBlkLuwgCCQOJ+eMYwk2hlU9rbf4R4 X-Received: by 2002:a17:906:5210:: with SMTP id g16mr16551412ejm.197.1590945397916; Sun, 31 May 2020 10:16:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590945397; cv=none; d=google.com; s=arc-20160816; b=kncYtAGF3G16bC2szLe2pAM4PSb+PyFOcFBSNlFw0utllpawLXWrnnw1IFTniWSQh/ 7Rzg634h0Ia93jcu028F27S4gvJN/qVb2HtPhJbKDJTv5vWbPTLZ/n1lgw7/AtjKAPOK f7eyabTy5gV0qHTIQUvlE3oqyzQXPh9B3jynWYIPINihgGDn2gbgIucBgFctSvU34J/z x3U3pnKRcnNa9cJlwghCbQ4Ky/eaAWp/yyL7n7Nau/9Ru+bikswNWNEpROxMKGIPXcH9 AqUHjqior/7DCWS1OpsH8DxvU9nLcg9kHkbgBOOfsA9gFVKfBfvht6t+MUajYqJ1H8Mz jqOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=Sbfl/PgE6aciSyttdhwPPowUU1Bk3b7feiomVnwBmwU=; b=Goj6zkJJqrc3tVfNS2prSZzby5pxjUDQqv7yk3FAqc1Es4ZW67B2faWgT0oYWZGYuX q+aqJZoRLLhKbLjY7HZPkfFRSJDVw0c4mTeHKAwHjpypoSygcq0TnAReVxLiedLDnzge mi9p4vCFFYYOhcMrqq9soZ9c4016wit1oPRLFeGTn08od/cL149iiTirbao+RS93bXtN k1+irvLlSuATVL1K98rWGzhhMu1EGx3hyVHI/F2r6t7hk9jMxQO7ucAe4a/uoxUbH+wN Oe7uPbL6lCEE7tMFq0Y868mDTP+n3AXs+qpHSxcxHowJ1cHRs/H9MrLmRdxkzkHcRn6D EMPw== 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 g8si9158580eje.444.2020.05.31.10.16.04; Sun, 31 May 2020 10:16:37 -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 S1728199AbgEaRMu (ORCPT + 99 others); Sun, 31 May 2020 13:12:50 -0400 Received: from mail.baikalelectronics.com ([87.245.175.226]:45784 "EHLO mail.baikalelectronics.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726081AbgEaRMu (ORCPT ); Sun, 31 May 2020 13:12:50 -0400 Received: from localhost (unknown [127.0.0.1]) by mail.baikalelectronics.ru (Postfix) with ESMTP id CDB5F8030866; Sun, 31 May 2020 17:12:41 +0000 (UTC) X-Virus-Scanned: amavisd-new at baikalelectronics.ru Received: from mail.baikalelectronics.ru ([127.0.0.1]) by localhost (mail.baikalelectronics.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WwALV05hloaX; Sun, 31 May 2020 20:12:40 +0300 (MSK) Date: Sun, 31 May 2020 20:12:39 +0300 From: Serge Semin To: Wolfram Sang CC: Serge Semin , Jarkko Nikula , Andy Shevchenko , Mika Westerberg , Alexey Malahov , Thomas Bogendoerfer , Rob Herring , , , , Subject: Re: [PATCH v6 08/11] i2c: designware: Convert driver to using regmap API Message-ID: <20200531171239.l64zfkoncecngfll@mobilestation> References: <20200528093322.23553-1-Sergey.Semin@baikalelectronics.ru> <20200528093322.23553-9-Sergey.Semin@baikalelectronics.ru> <20200530110930.GC1038@ninjato> <20200530210554.GA15682@ninjato> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20200530210554.GA15682@ninjato> X-ClientProxiedBy: MAIL.baikal.int (192.168.51.25) To mail (192.168.51.25) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, May 30, 2020 at 11:05:54PM +0200, Wolfram Sang wrote: > 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, which > > > glue-driver is a part of this series). > > > > > > As before the driver tries to detect the mapping setup at probe stage and > > > 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. > > > > > > 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). > > > > > > 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 > > > > My codecheckers found these, rightfully I'd say: > > > > SPARSE > > drivers/i2c/busses/i2c-designware-master.c:427:53: warning: incorrect type in argument 3 (different signedness) > > drivers/i2c/busses/i2c-designware-master.c:427:53: expected unsigned int *val > > drivers/i2c/busses/i2c-designware-master.c:427:53: got int * > > > > CC > > drivers/i2c/busses/i2c-designware-common.c:127: warning: Excess function parameter 'base' description in 'i2c_dw_init_regmap' > > > > ^ means there is an argument documented which does not exist in the > > function declaration > > Well, I fixed these two minor things for your now... > Great! Sorry for me not doing it on time. I was away from my laptop and internet last day to do that. I saw your message about the sparse detecting the problems while I was on my way to outskirts and was going to fix them today either in a new version of the patchset or sending follow-up patches. But you already fixed the problems. Thank you very much for doing that for me. -Sergey