Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp177066ybl; Wed, 11 Dec 2019 16:07:50 -0800 (PST) X-Google-Smtp-Source: APXvYqzuREYP//H/jSvGZ0z/XgSkZUKf6k6ejo3crJq9Muy0W9WSJ0D0tcbWi6HdQrLR+EykjyR7 X-Received: by 2002:a05:6830:1af8:: with SMTP id c24mr4621924otd.362.1576109270232; Wed, 11 Dec 2019 16:07:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576109270; cv=none; d=google.com; s=arc-20160816; b=mIIJhFZ0TeDHfHG5mMDtdw2Bs/kec8bFrklerRLUiT/ULRity6K8kiLTS6/7bzWcw3 ZkxccQ1LOTTdBJ0zNYzkB2CSbxr9NXKIzgUFMU+e4t0ASjb9W7reqK6+zlEweewSfYAM JKmUFz7YOpPo6yB4pTez/BeqQr82tnQli5aTUtZR/4tWhdOigm/DKxXdP8Q8cTzOPoY9 lF1Y7Rm+9NiYnfxFFzaHm7MJMtklcnOmigSNITz3a1L621P6tdN4S5/afAUEMHPdEK45 gB0sZBWbPTPHnxHLYO9lEw3Kw4BDZwuJHmJGP4xQH/5uyVhivK8rARI2mXm7NmEhvYlG kuOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:to:from; bh=47H0jBejZZI1h4f239A2MVXWxterYS+T9OYGgOSKTQw=; b=dBuz56gYwCGyEN+TDtDnzXXi0Z/oXmfRGNInMDu/AXfLClYFekXFGxzz7fex7wxsOj n8CuziNPWO2W/Gn+gUjcxpotJ4HER5eZd8GFlsVcqfaLgbnypqvJKXvS/55uYo+mBEMg 6/jrh0vw6sL2kMYo7hlMyyQt3sUuc8+UpSQEvhmr85T70tRnrnfDhm4/ElcG0ubBaiwv 7DbgCzbDIE5E8oHUWfoKGN3LLUqr1sVIgtNITyEoarnZNOuwOTeN85kzewmdIU/t1mZC WzmRiczKrTTD7H4B0PwXhtig9z8eB089MQeUfN6QK+bCDr2rO0+7UpuVl1/VEL7USQNX LE2g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a136si2190344oib.252.2019.12.11.16.07.36; Wed, 11 Dec 2019 16:07:50 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727126AbfLLAHF (ORCPT + 99 others); Wed, 11 Dec 2019 19:07:05 -0500 Received: from vegas.theobroma-systems.com ([144.76.126.164]:56555 "EHLO mail.theobroma-systems.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726897AbfLLAHE (ORCPT ); Wed, 11 Dec 2019 19:07:04 -0500 X-Greylist: delayed 1656 seconds by postgrey-1.27 at vger.kernel.org; Wed, 11 Dec 2019 19:07:03 EST Received: from ip092042140082.rev.nessus.at ([92.42.140.82]:60538 helo=localhost.localdomain) by mail.theobroma-systems.com with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1ifBZm-0001xP-07; Thu, 12 Dec 2019 00:39:26 +0100 From: christoph.muellner@theobroma-systems.com To: Till Harbaum , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, christoph.muellner@theobroma-systems.com Subject: [PATCH] i2c: tiny-usb: Correct I2C fault codes. Date: Thu, 12 Dec 2019 00:39:05 +0100 Message-Id: <20191211233905.84056-1-christoph.muellner@theobroma-systems.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Christoph Müllner This patch changes the I2C fault codes according to the specified values in Documentation/i2c/fault-codes. Signed-off-by: Christoph Müllner --- drivers/i2c/busses/i2c-tiny-usb.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/i2c/busses/i2c-tiny-usb.c b/drivers/i2c/busses/i2c-tiny-usb.c index 43e3603489ee..7279ca0eaa2d 100644 --- a/drivers/i2c/busses/i2c-tiny-usb.c +++ b/drivers/i2c/busses/i2c-tiny-usb.c @@ -84,7 +84,7 @@ static int usb_xfer(struct i2c_adapter *adapter, struct i2c_msg *msgs, int num) pmsg->buf, pmsg->len) != pmsg->len) { dev_err(&adapter->dev, "failure reading data\n"); - ret = -EREMOTEIO; + ret = -EIO; goto out; } } else { @@ -94,7 +94,7 @@ static int usb_xfer(struct i2c_adapter *adapter, struct i2c_msg *msgs, int num) pmsg->buf, pmsg->len) != pmsg->len) { dev_err(&adapter->dev, "failure writing data\n"); - ret = -EREMOTEIO; + ret = -EIO; goto out; } } @@ -102,13 +102,13 @@ static int usb_xfer(struct i2c_adapter *adapter, struct i2c_msg *msgs, int num) /* read status */ if (usb_read(adapter, CMD_GET_STATUS, 0, 0, pstatus, 1) != 1) { dev_err(&adapter->dev, "failure reading status\n"); - ret = -EREMOTEIO; + ret = -EIO; goto out; } dev_dbg(&adapter->dev, " status = %d\n", *pstatus); if (*pstatus == STATUS_ADDRESS_NAK) { - ret = -EREMOTEIO; + ret = -ENXIO; goto out; } } -- 2.23.0