Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp182330ybl; Wed, 11 Dec 2019 16:13:39 -0800 (PST) X-Google-Smtp-Source: APXvYqwM6f0xCpf5QdPqTOXPh58E82h4uNJZZXB/IuOIYwEh5O3EoO/m2DWLAErK/2DlkQznSudc X-Received: by 2002:a05:6830:1bf1:: with SMTP id k17mr4714245otb.101.1576109619341; Wed, 11 Dec 2019 16:13:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576109619; cv=none; d=google.com; s=arc-20160816; b=K4h0868K+Fzs+/8mSC2K3WTro1TMYHydXJxA5smDC0VUw3hlKeGPyBT5q4Hyk/53ix D0uIuqmu9B9zNt2AZmW8HYWhNMcq85X32cDaBhoPFcFVJJ5gVUYs52b5MGOX2BBZNEZ8 u48kkZWoE1xpohK2BEcfdygZOZ5OGHH6cRADUPAQkljQuzA6q87p6sls9x2v+O+RENn8 AJb78WWDuJUka5Uczo1T/CDPZcdMosGcFkqVdhj07Lbw41CJUMYYOImf3qPygTffrn9u PeFAoBPdqPo1dcOPseTtGjl7asfFW8IzHQxjyaPE+Yf52p7++zZzfcVQV4fyvIvBA4pN zNNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:content-transfer-encoding:mime-version :message-id:date:subject:cc:from; bh=47H0jBejZZI1h4f239A2MVXWxterYS+T9OYGgOSKTQw=; b=wAWBYnK7vQLeNpGogoa0Bp7qXYrvS3oSq5q/Sge6akR0vcYexPYvLGeO/lRzb9d8kX ntOdbUlP+aWfO5b9/KL2v2FoKsZYhYU2DsGXD5n4afUb9h4CoqznGLRc01iOr7NSIpzZ imG2MRuiPHhZrZzJWGXyFxkTnTpS1jY0vK3etQCLY57C2pdCDCHmxwZxQVqf5P0jYmnk uMohju/2PuDG4VqeezQjL9hfh8h166eil93Wp15Hxjnv6QPrZeBPBytM6dlIKyHQ5fm3 MLx6q/uG5GzXsy1IYSyfszLghXtS7Z/7pFzRQcbtjktMdR2EVmEA3uIpFAm6CDdjws9+ V+ng== 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 z11si2234536oic.119.2019.12.11.16.13.27; Wed, 11 Dec 2019 16:13:39 -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 S1727267AbfLLAM5 (ORCPT + 99 others); Wed, 11 Dec 2019 19:12:57 -0500 Received: from vegas.theobroma-systems.com ([144.76.126.164]:52765 "EHLO mail.theobroma-systems.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727067AbfLLAM5 (ORCPT ); Wed, 11 Dec 2019 19:12:57 -0500 Received: from 212-186-62-102.cable.dynamic.surfer.at ([212.186.62.102]:35684 helo=cm.fritz.box) by mail.theobroma-systems.com with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1ifC6A-0002dD-Ow; Thu, 12 Dec 2019 01:12:54 +0100 From: christoph.muellner@theobroma-systems.com Cc: =?UTF-8?q?Christoph=20M=C3=BCllner?= , Till Harbaum , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] i2c: tiny-usb: Correct I2C fault codes. Date: Thu, 12 Dec 2019 01:12:50 +0100 Message-Id: <20191212001251.85344-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 To: unlisted-recipients:; (no To-header on input) 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