From patchwork Fri Mar 16 22:48:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rodrigo Siqueira X-Patchwork-Id: 10290421 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8B06860386 for ; Fri, 16 Mar 2018 22:48:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 79A9F290DA for ; Fri, 16 Mar 2018 22:48:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6E215290DC; Fri, 16 Mar 2018 22:48:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 188C4290DA for ; Fri, 16 Mar 2018 22:48:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752192AbeCPWs6 (ORCPT ); Fri, 16 Mar 2018 18:48:58 -0400 Received: from mail-qk0-f195.google.com ([209.85.220.195]:35874 "EHLO mail-qk0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751348AbeCPWs5 (ORCPT ); Fri, 16 Mar 2018 18:48:57 -0400 Received: by mail-qk0-f195.google.com with SMTP id d206so12751476qkb.3; Fri, 16 Mar 2018 15:48:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=hON5SYlQ3w4UgncWIwBnhJfL8GHxRPtvDUxpou25DxQ=; b=IEzXS/mOXxMxhyVgj5BfeuNnKl8Xe8Spo7WYRhKedmj0QF3k7WOQ9GDbjWGF7BuJjo GCVELPOvr6VqZvOd9GK7e7sF14uGF0vhEMbs0I59gluWpAAb2tA50AzdzzCU4bWA5UuJ WkGPEiiV+4I18llY+twpiZSFXFTer8XvKLleevNsAVbQWhXN9QXFsPbVx2M+pxlHhiKA KTiePISLX3P2Z0MoTwNS84eQ3JziXFnFYUZC1vPqkpeDn6jZiV2hJXe1RK5zKYjjAy9h KoJ72QJNLjokTNifQxCmuAsbxXugUR3ukiaPDSMk0M87WVm4+SvpXi5yc1eIGRbMB+y1 vL6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=hON5SYlQ3w4UgncWIwBnhJfL8GHxRPtvDUxpou25DxQ=; b=TSUVuXLDkCz0hWQpTWIqLrAAfcv32TwtS+dVYNV1iFJFY3NL1F6NwIt9qCwoXfk8YF /YsIu/7FfXHKytetQSh9+Ca3wALQGwcq5IwV/Dw19AHgbdJGcIjZVVgmFyDd6AnbA+ce WNLHUrA/hXH8SEdyQQVsYXoSn5nG0SssHnrIq7Zw2E9t3MZHDlYEHhgqT4rGdWpYjEC0 Rj67lFtsKbnSrxd4JTg3rmTOSZIkd1r1O01dPoE6K5oTGuR508QuTT5IvTsgSTxiA3Kw 3OOMC6tmQ3sM36U1uwJwq9yESegfqyc3Qr/87IP3Gs1cLl4W+0Z8tfHK7nzzoXHPr8AY 8uKA== X-Gm-Message-State: AElRT7EYYem9eW4gqSK6fpg/ZlKjqRZEEnVGQ8uFSwT0qPMzUs6v8cWj dJ3IQXdkOH2ubEZ6KNEtW8E= X-Google-Smtp-Source: AG47ELtv99vwnWlYtVEawf6J94qJKTbfnR9HcmJnFgcmiI4+VOdJ7xo3sSgI1ykuGnwRRldSnYAQ3Q== X-Received: by 10.55.153.3 with SMTP id b3mr5072797qke.65.1521240536688; Fri, 16 Mar 2018 15:48:56 -0700 (PDT) Received: from smtp.gmail.com ([143.107.45.1]) by smtp.gmail.com with ESMTPSA id e64sm3008594qka.18.2018.03.16.15.48.53 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 16 Mar 2018 15:48:56 -0700 (PDT) Date: Fri, 16 Mar 2018 19:48:51 -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 2/8] staging:iio:ade7854: Fix the wrong number of bits to read Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180223 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The function ade7854_i2c_read_reg_32() have to invoke the i2c_master_recv() for read 32 bits values, however, the counter is set to 3 which means 24 bits. This patch fixes the wrong size of 24 bits, to 32 bits. Finally, this patch is based on John Syne patches. Signed-off-by: Rodrigo Siqueira Signed-off-by: John Syne --- drivers/staging/iio/meter/ade7854-i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/iio/meter/ade7854-i2c.c b/drivers/staging/iio/meter/ade7854-i2c.c index 4437f1e33261..37c957482493 100644 --- a/drivers/staging/iio/meter/ade7854-i2c.c +++ b/drivers/staging/iio/meter/ade7854-i2c.c @@ -191,7 +191,7 @@ static int ade7854_i2c_read_reg_32(struct device *dev, if (ret < 0) goto out; - ret = i2c_master_recv(st->i2c, st->rx, 3); + ret = i2c_master_recv(st->i2c, st->rx, 4); if (ret < 0) goto out;