From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752222AbcAGKL3 (ORCPT ); Thu, 7 Jan 2016 05:11:29 -0500 Received: from metis.ext.4.pengutronix.de ([92.198.50.35]:52034 "EHLO metis.ext.4.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750707AbcAGKL0 convert rfc822-to-8bit (ORCPT ); Thu, 7 Jan 2016 05:11:26 -0500 From: Juergen Borleis Organization: Pengutronix e.K. To: kernel@pengutronix.de Subject: Re: [PATCH 2/3] RTC/PCF85063: fix time/date reading (part II) Date: Thu, 7 Jan 2016 11:12:52 +0100 User-Agent: KMail/1.9.10 (enterprise35 0.20100827.1168748) Cc: rtc-linux@googlegroups.com, Alessandro Zummo , Alexandre Belloni , linux-kernel@vger.kernel.org References: <1449496174-7813-1-git-send-email-jbe@pengutronix.de> <1449496174-7813-3-git-send-email-jbe@pengutronix.de> In-Reply-To: <1449496174-7813-3-git-send-email-jbe@pengutronix.de> X-KMail-QuotePrefix: > MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 8BIT Content-Disposition: inline Message-Id: <201601071112.52284.jbe@pengutronix.de> X-SA-Exim-Connect-IP: 2001:67c:670:201:5054:ff:fe8d:eefb X-SA-Exim-Mail-From: jbe@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Alexandre, (please keep me on CC...) > [...] > > - /* read registers */ > > - if ((i2c_transfer(client->adapter, msgs, 2)) != 2) { > > - dev_err(&client->dev, "%s: read error\n", __func__); > > - return -EIO; > > Isn't that already reading the time and date register in one block? I'd > say you are simply reading less registers. Also, maybe you could use > i2c_smbus_read_block_data? Its just a "try" to make the code more readable, by a named subfunction and more comments why things must happen that way. Will check for the suggested smbus function. Regards, Juergen -- Pengutronix e.K.                              | Juergen Borleis             | Industrial Linux Solutions                    | http://www.pengutronix.de/  | From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de. [2001:67c:670:201:290:27ff:fe1d:cc33]) by gmr-mx.google.com with ESMTPS id d185si328293wmf.0.2016.01.07.02.11.24 for (version=TLS1_2 cipher=AES128-SHA bits=128/128); Thu, 07 Jan 2016 02:11:24 -0800 (PST) From: Juergen Borleis To: kernel@pengutronix.de Subject: [rtc-linux] Re: [PATCH 2/3] RTC/PCF85063: fix time/date reading (part II) Date: Thu, 7 Jan 2016 11:12:52 +0100 Cc: rtc-linux@googlegroups.com, Alessandro Zummo , Alexandre Belloni , linux-kernel@vger.kernel.org References: <1449496174-7813-1-git-send-email-jbe@pengutronix.de> <1449496174-7813-3-git-send-email-jbe@pengutronix.de> In-Reply-To: <1449496174-7813-3-git-send-email-jbe@pengutronix.de> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Message-Id: <201601071112.52284.jbe@pengutronix.de> Reply-To: rtc-linux@googlegroups.com List-ID: List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Hi Alexandre, (please keep me on CC...) > [...] > > - /* read registers */ > > - if ((i2c_transfer(client->adapter, msgs, 2)) !=3D 2) { > > - dev_err(&client->dev, "%s: read error\n", __func__); > > - return -EIO; > > Isn't that already reading the time and date register in one block? I'd > say you are simply reading less registers. Also, maybe you could use > i2c_smbus_read_block_data? Its just a "try" to make the code more readable, by a named subfunction and= =20 more comments why things must happen that way. Will check for the suggested smbus function. Regards, Juergen =2D-=20 Pengutronix e.K. =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0| Juergen Borleis =A0 =A0 =A0 =A0 =A0 =A0 | Industrial Linux Solutions =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| http://= www.pengutronix.de/ =A0|