From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Cyrus-Session-Id: sloti22d1t05-4051070-1521240511-2-14593846616125645927 X-Sieve: CMU Sieve 3.0 X-Spam-known-sender: no ("Email failed DMARC policy for domain") X-Spam-score: 0.0 X-Spam-hits: BAYES_00 -1.9, FREEMAIL_FORGED_FROMDOMAIN 0.249, FREEMAIL_FROM 0.001, HEADER_FROM_DIFFERENT_DOMAINS 0.25, RCVD_IN_DNSWL_MED -2.3, SPF_PASS -0.001, LANGUAGES en, BAYES_USED global, SA_VERSION 3.4.0 X-Spam-source: IP='140.211.166.138', Host='smtp1.osuosl.org', Country='US', FromHeader='com', MailFrom='org' X-Spam-charsets: plain='us-ascii' X-IgnoreVacation: yes ("Email failed DMARC policy for domain") X-Resolved-to: greg@kroah.com X-Delivered-to: greg@kroah.com X-Mail-from: driverdev-devel-bounces@linuxdriverproject.org ARC-Seal: i=1; a=rsa-sha256; cv=none; d=messagingengine.com; s=arctest; t=1521240510; b=J/WaOZrAHeOzgkgOyXmSYEWvPVS36mJI2rrF/T4cu/PNiV0 1S8AEuGCnxcgLeOooUiHudvLxe4vTRfx0SqK5GVP1ZiNrecooYEnolGQIQxMGZDv mzUrRlFGMEPLHTmZdkaokn6IQnsMkpX1ud9GrNkFDunMXro0DWzWSj5Lsz0Ewn37 NlaV0hLBCaUoJ4Fmbi8gRdZMW3+kLS4PDZs2UMWGdrozVWfeuNIGuINjyEvEvx3a sjkm7ViWNSkKY8DJPf3X0NgPh/GuTa7yb3erkBWkFYM2A5+bWMqzDpst8pr5oj2w cEOGGJpE5CPsPNgDAYeh6gL9lwqcWWAWTAdgU1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=date:from:to:subject:message-id :mime-version:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:cc:content-type :content-transfer-encoding:sender; s=arctest; t=1521240510; bh=G b7V+iKZ7udt4gXW+gkiC7zruCLi3neBt+3HH84VJ/k=; b=vMkh1a3q9fhIuU/WC iE1bTXwz1EIB0WYrqZ/tc9o5SwvRovz7uIP1vWi1H8oSZb3cMycip9sFRzbnvS54 6w2MWqj3M3okW1TmV2kNXK/h8kSjKI+6/TzA3b7NKAnqwTZnXpXTk4n5rVXvGNsV p5K/WkOjJ5hz/+FCMBMQBDYz4WpN36y58csfytHCsABgTcsNvPG7IuM4+9mta5jV wevr+I391J//FOapuCw1w9QuXYmQyqQiHzQDhbIG5py3ja8ktGuksnSHfCQ8mMVD aVFAFlSqi7Hc1n+akQY0+bQjyn67IS6UliPuzq55vnVXB5jO2NWJ4b2V41lWVCyo 7cvLQ== ARC-Authentication-Results: i=1; mx3.messagingengine.com; arc=none (no signatures found); dkim=fail (message has been altered; 2048-bit rsa key sha256) header.d=gmail.com header.i=@gmail.com header.b=NtD94AB2 x-bits=2048 x-keytype=rsa x-algorithm=sha256 x-selector=20161025; dmarc=fail (p=none,has-list-id=yes,d=none) header.from=gmail.com; iprev=pass policy.iprev=140.211.166.138 (smtp1.osuosl.org); spf=pass smtp.mailfrom=driverdev-devel-bounces@linuxdriverproject.org smtp.helo=whitealder.osuosl.org; x-aligned-from=fail; x-category=clean score=-100 state=0; x-google-dkim=fail (message has been altered; 2048-bit rsa key) header.d=1e100.net header.i=@1e100.net header.b=J0up7QF/; x-ptr=fail x-ptr-helo=whitealder.osuosl.org x-ptr-lookup=smtp1.osuosl.org; x-return-mx=pass smtp.domain=linuxdriverproject.org smtp.result=pass smtp_is_org_domain=yes header.domain=gmail.com header.result=pass header_is_org_domain=yes; x-tls=pass version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128 Authentication-Results: mx3.messagingengine.com; arc=none (no signatures found); dkim=fail (message has been altered; 2048-bit rsa key sha256) header.d=gmail.com header.i=@gmail.com header.b=NtD94AB2 x-bits=2048 x-keytype=rsa x-algorithm=sha256 x-selector=20161025; dmarc=fail (p=none,has-list-id=yes,d=none) header.from=gmail.com; iprev=pass policy.iprev=140.211.166.138 (smtp1.osuosl.org); spf=pass smtp.mailfrom=driverdev-devel-bounces@linuxdriverproject.org smtp.helo=whitealder.osuosl.org; x-aligned-from=fail; x-category=clean score=-100 state=0; x-google-dkim=fail (message has been altered; 2048-bit rsa key) header.d=1e100.net header.i=@1e100.net header.b=J0up7QF/; x-ptr=fail x-ptr-helo=whitealder.osuosl.org x-ptr-lookup=smtp1.osuosl.org; x-return-mx=pass smtp.domain=linuxdriverproject.org smtp.result=pass smtp_is_org_domain=yes header.domain=gmail.com header.result=pass header_is_org_domain=yes; x-tls=pass version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128 X-Remote-Delivered-To: driverdev-devel@osuosl.org X-Google-Smtp-Source: AG47ELtakd1t349UyGFNecLrdFkGHfB24nxz25tObHnuKJC9iXBiU+gKTop5selKM4l5IfMhjSQ69w== Date: Fri, 16 Mar 2018 19:48:18 -0300 From: Rodrigo Siqueira To: John Syne , Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , Greg Kroah-Hartman , linux-iio@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, Barry Song <21cnbao@gmail.com> Subject: [PATCH v2 0/8] staging:iio:ade7854: Cleanup on I2C/SPI code Message-ID: MIME-Version: 1.0 Content-Disposition: inline User-Agent: NeoMutt/20180223 X-BeenThere: driverdev-devel@linuxdriverproject.org X-Mailman-Version: 2.1.24 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-iio@vger.kernel.org, devel@driverdev.osuosl.org, daniel.baluta@nxp.com, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: driverdev-devel-bounces@linuxdriverproject.org Sender: "devel" X-getmail-retrieved-from-mailbox: INBOX X-Mailing-List: linux-kernel@vger.kernel.org List-ID: This patchset reworks the I2C/SPI code from meter module. The set of patches try to reduce the code duplication and make the communication reliable. The current version of the module had many code duplications, which make the code more error-prone and hard to read. Jonh Syne identified some wrong error handling and fixed it in his patches; in this series of patches I analyzed Jonh's fixes, and use it in the new code. It is important to highlight that meter module is under observation, due to the lack of hardware and the old design of the chip. However, John has the hardware for testing and interest to help to update the code [1]. As a result, this patchset represents the first work effort to update the meter module in the staging. 1 - https://marc.info/?l=linux-iio&m=152046885922153&w=2 Changes in V2: - Reorganize the patchset to make easier to backport fixes. - Adds two commits at the beginning of the patchset. First, fixes bugs related to wrong verification in read/write I2C operations. Second, adjust the incorrect amount of data read. - Removes unnecessary code in read/write functions for SPI and I2C during the rework. Rodrigo Siqueira (8): staging:iio:ade7854: Fix error handling on read/write staging:iio:ade7854: Fix the wrong number of bits to read staging:iio:ade7854: Rework I2C write function staging:iio:ade7854: Rework SPI write function staging:iio:ade7854: Replace many functions for one function staging:iio:ade7854: Rework I2C read function staging:iio:ade7854: Rework SPI read function staging:iio:ade7854: Remove read_reg_* duplications drivers/staging/iio/meter/ade7854-i2c.c | 238 +++++++++------------------- drivers/staging/iio/meter/ade7854-spi.c | 268 +++++++------------------------- drivers/staging/iio/meter/ade7854.c | 40 ++--- drivers/staging/iio/meter/ade7854.h | 23 +-- 4 files changed, 159 insertions(+), 410 deletions(-) -- 2.16.2 _______________________________________________ devel mailing list devel@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt0-f195.google.com ([209.85.216.195]:41921 "EHLO mail-qt0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751348AbeCPWsX (ORCPT ); Fri, 16 Mar 2018 18:48:23 -0400 Date: Fri, 16 Mar 2018 19:48:18 -0300 From: Rodrigo Siqueira To: John Syne , Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , Greg Kroah-Hartman , linux-iio@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, Barry Song <21cnbao@gmail.com> Cc: daniel.baluta@nxp.com, linux-iio@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 0/8] staging:iio:ade7854: Cleanup on I2C/SPI code Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: linux-iio-owner@vger.kernel.org List-Id: linux-iio@vger.kernel.org This patchset reworks the I2C/SPI code from meter module. The set of patches try to reduce the code duplication and make the communication reliable. The current version of the module had many code duplications, which make the code more error-prone and hard to read. Jonh Syne identified some wrong error handling and fixed it in his patches; in this series of patches I analyzed Jonh's fixes, and use it in the new code. It is important to highlight that meter module is under observation, due to the lack of hardware and the old design of the chip. However, John has the hardware for testing and interest to help to update the code [1]. As a result, this patchset represents the first work effort to update the meter module in the staging. 1 - https://marc.info/?l=linux-iio&m=152046885922153&w=2 Changes in V2: - Reorganize the patchset to make easier to backport fixes. - Adds two commits at the beginning of the patchset. First, fixes bugs related to wrong verification in read/write I2C operations. Second, adjust the incorrect amount of data read. - Removes unnecessary code in read/write functions for SPI and I2C during the rework. Rodrigo Siqueira (8): staging:iio:ade7854: Fix error handling on read/write staging:iio:ade7854: Fix the wrong number of bits to read staging:iio:ade7854: Rework I2C write function staging:iio:ade7854: Rework SPI write function staging:iio:ade7854: Replace many functions for one function staging:iio:ade7854: Rework I2C read function staging:iio:ade7854: Rework SPI read function staging:iio:ade7854: Remove read_reg_* duplications drivers/staging/iio/meter/ade7854-i2c.c | 238 +++++++++------------------- drivers/staging/iio/meter/ade7854-spi.c | 268 +++++++------------------------- drivers/staging/iio/meter/ade7854.c | 40 ++--- drivers/staging/iio/meter/ade7854.h | 23 +-- 4 files changed, 159 insertions(+), 410 deletions(-) -- 2.16.2