From mboxrd@z Thu Jan 1 00:00:00 1970 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.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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 861B4C2D0E4 for ; Mon, 23 Nov 2020 21:38:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 232B320721 for ; Mon, 23 Nov 2020 21:38:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730713AbgKWViP (ORCPT ); Mon, 23 Nov 2020 16:38:15 -0500 Received: from relay10.mail.gandi.net ([217.70.178.230]:34543 "EHLO relay10.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728940AbgKWViP (ORCPT ); Mon, 23 Nov 2020 16:38:15 -0500 Received: from localhost (lfbn-lyo-1-997-19.w86-194.abo.wanadoo.fr [86.194.74.19]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay10.mail.gandi.net (Postfix) with ESMTPSA id BDBBC240009; Mon, 23 Nov 2020 21:38:08 +0000 (UTC) Date: Mon, 23 Nov 2020 22:38:08 +0100 From: Alexandre Belloni To: Jonathan =?iso-8859-1?Q?Neusch=E4fer?= Cc: linux-kernel@vger.kernel.org, Lee Jones , Rob Herring , Thierry Reding , Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= , Alessandro Zummo , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Sam Ravnborg , Linus Walleij , Heiko Stuebner , Stephan Gerhold , Lubomir Rintel , Mark Brown , allen , Mauro Carvalho Chehab , "David S. Miller" , devicetree@vger.kernel.org, linux-pwm@vger.kernel.org, linux-rtc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Heiko Stuebner , Josua Mayer , Andreas Kemnade , Arnd Bergmann , Daniel Palmer , Andy Shevchenko Subject: Re: [PATCH v4 5/7] rtc: New driver for RTC in Netronix embedded controller Message-ID: <20201123213808.GP348979@piout.net> References: <20201122222739.1455132-1-j.neuschaefer@gmx.net> <20201122222739.1455132-6-j.neuschaefer@gmx.net> <20201122231054.GH348979@piout.net> <20201123213105.GC456020@latitude> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20201123213105.GC456020@latitude> Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On 23/11/2020 22:31:05+0100, Jonathan Neuschäfer wrote: > > > + res = regmap_write(rtc->ec->regmap, NTXEC_REG_WRITE_MINUTE, ntxec_reg8(tm->tm_min)); > > > + if (res) > > > + return res; > > > + > > > + return regmap_write(rtc->ec->regmap, NTXEC_REG_WRITE_SECOND, ntxec_reg8(tm->tm_sec)); > > > > Couldn't you do a regmap_block_write or a regmap_multi_reg_write which > > would be more efficient as they would be locking the regmap only once. > > I can't find regmap_block_write anywhere, but regmap_multi_reg_write > looks like a good approach to simplify the code here. > I was thinking regmap_bulk_write but regmap_multi_reg_write is probably more fitting here. > > [...] > > Note that this won't compile after > > https://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux.git/commit/?id=fdcfd854333be5b30377dc5daa9cd0fa1643a979 > > > > We can solve that with immutable branches though. > > Thanks for the heads-up. Please let me know if/when there is any action > that I need to take here. > I wouldn't think so, I can carry a patch once Lee provides his usual immutable branch. -- Alexandre Belloni, Bootlin Embedded Linux and Kernel engineering https://bootlin.com