From patchwork Mon Apr 20 22:14:47 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 6244581 Return-Path: X-Original-To: patchwork-linux-rockchip@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 285B3BF4A6 for ; Mon, 20 Apr 2015 22:15:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 290642024F for ; Mon, 20 Apr 2015 22:15:26 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5C49D20220 for ; Mon, 20 Apr 2015 22:15:25 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YkJyN-0004ji-70; Mon, 20 Apr 2015 22:15:23 +0000 Received: from mail-ig0-x232.google.com ([2607:f8b0:4001:c05::232]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YkJyD-0003Wv-Ne; Mon, 20 Apr 2015 22:15:14 +0000 Received: by iget9 with SMTP id t9so74753787ige.1; Mon, 20 Apr 2015 15:14:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=ZE31VS+ov/GlZJMBxM5hdclUYXFusZS3Fou6/d79Gac=; b=x0iwu6XSoP9quxWnpVc1oARC4OGTGBBokq/5Bl8Uf25WzIHARfNrQMTXwL4jHEobgW Fwq6i+INA3Fd7TWZsoVJls4Wxzj5zUfX4J3fOM+dj7sKIZPSjJKxt3VT1bwxLf0k3Sia 4apuz+1HNKvxzE4TdxUYdoBiY4FV+CSDJWhdLttVs2XaxvO0NQGjrArmFBM2CGesLBjz THRUhgBtqNPKGrLUaEese9DvORe+83PG4w04kvXmEmj+OkIB5fzEMBQBdAlfvSmSqt7w gF86vYXUQwbTUXLbyP7u8ATD00+QX9wUO9byiow+CI8V1vhqO4Okw/FpWuRLRkSPvsLK MhQA== X-Received: by 10.107.134.23 with SMTP id i23mr24437969iod.90.1429568091607; Mon, 20 Apr 2015 15:14:51 -0700 (PDT) Received: from dtor-ws ([2620:0:1000:1301:b4a4:15d2:d9fe:1711]) by mx.google.com with ESMTPSA id r39sm12147138ioe.25.2015.04.20.15.14.49 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 20 Apr 2015 15:14:50 -0700 (PDT) Date: Mon, 20 Apr 2015 15:14:47 -0700 From: Dmitry Torokhov To: Heiko Stuebner Subject: [PATCH] i2c: rk3x: report number of messages transmitted Message-ID: <20150420221447.GA2005@dtor-ws> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150420_151513_944732_A10B601D X-CRM114-Status: UNSURE ( 8.77 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.8 (/) Cc: Addy Ke , Alexandru M Stan , Wolfram Sang , Max Schwarz , Doug Anderson , linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-i2c@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP master_xfer() method should return number of i2c messages transferred, but on Rockchip we were usually returning just 1, which caused trouble with users that actually check number of transferred messages vs. checking for negative error codes. Signed-off-by: Dmitry Torokhov --- drivers/i2c/busses/i2c-rk3x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-rk3x.c b/drivers/i2c/busses/i2c-rk3x.c index 5f96b1b..019d542 100644 --- a/drivers/i2c/busses/i2c-rk3x.c +++ b/drivers/i2c/busses/i2c-rk3x.c @@ -833,7 +833,7 @@ static int rk3x_i2c_xfer(struct i2c_adapter *adap, clk_disable(i2c->clk); spin_unlock_irqrestore(&i2c->lock, flags); - return ret; + return ret < 0 ? ret : num; } static u32 rk3x_i2c_func(struct i2c_adapter *adap)