From patchwork Mon Jul 25 20:11:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guenter Roeck X-Patchwork-Id: 652397 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3ryspB5s4Bz9sdg for ; Tue, 26 Jul 2016 06:11:14 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=roeck-us.net header.i=@roeck-us.net header.b=caGe41/a; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752487AbcGYULN (ORCPT ); Mon, 25 Jul 2016 16:11:13 -0400 Received: from bh-25.webhostbox.net ([208.91.199.152]:34787 "EHLO bh-25.webhostbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752463AbcGYULM (ORCPT ); Mon, 25 Jul 2016 16:11:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=roeck-us.net; s=default; h=Message-Id:Date:Subject:Cc:To:From; bh=TmmXJg4zURwe9VUFx5k+7vZ9uCnroOuMR6VAsWPrTfc=; b=caGe41/aNmUr8KWBh8HFDkJeMC reaNaixO1cPlKSj5mxx4ObREJRtmms6aCgVqvYHYex+96dLsF3FqTWtE4Wa3Q2AWu5e3bVyjl/kUc j0F0bUpult4WK8QognPiegXA6iLkKN3yHN9+Cf99947SrIqdQTDT2WCyzGMB/mfNDZFrjYkQssI+b lNaHw/siu/sfAi9etVBcD67XUer4Ml9lwYeQEnOCXEy57NwhKC1v2o9Nf4Bc3dZNSih1ijSOWtirs JeJygWTdQEtMKRzDLTtdu9Myp8DfSvgAT3qm6GrMg+1/qaYuCtfuGXnJyKyWozgBrNstckVlG3Q6S /2LE749Q==; Received: from 108-223-40-66.lightspeed.sntcca.sbcglobal.net ([108.223.40.66]:57412 helo=localhost) by bh-25.webhostbox.net with esmtpa (Exim 4.86_1) (envelope-from ) id 1bRmDR-002IYC-RG; Mon, 25 Jul 2016 20:11:06 +0000 From: Guenter Roeck To: Wolfram Sang Cc: dianders@chromium.org, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Guenter Roeck Subject: [PATCH] i2c: i2c-cros-ec-tunnel: Reduce logging noise Date: Mon, 25 Jul 2016 13:11:04 -0700 Message-Id: <1469477464-28735-1-git-send-email-linux@roeck-us.net> X-Mailer: git-send-email 2.5.0 X-Authenticated_sender: guenter@roeck-us.net X-OutGoing-Spam-Status: No, score=-1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bh-25.webhostbox.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roeck-us.net X-Get-Message-Sender-Via: bh-25.webhostbox.net: authenticated_id: guenter@roeck-us.net X-Authenticated-Sender: bh-25.webhostbox.net: guenter@roeck-us.net X-Source: X-Source-Args: X-Source-Dir: Sender: linux-i2c-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org If an i2c access through i2c-cros-ec-tunnel returns an error, the following log message is seen on the console. cros-ec-i2c-tunnel ff200000.spi:ec@0:i2c-tunnel: Error parsing EC i2c message -121 This can happen a lot if, for example, the i2c-detect command is executed. Since it is perfectly normal for an i2c controller to report an error, replace the error message with a debug message. Also, report -ENXIO instead of -EREMOTEIO if the access error is due to NAK from the device, as suggested in Documentation/i2c/fault-codes. Signed-off-by: Guenter Roeck --- drivers/i2c/busses/i2c-cros-ec-tunnel.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/i2c/busses/i2c-cros-ec-tunnel.c b/drivers/i2c/busses/i2c-cros-ec-tunnel.c index a0d95ff682ae..95f26fecc6e9 100644 --- a/drivers/i2c/busses/i2c-cros-ec-tunnel.c +++ b/drivers/i2c/busses/i2c-cros-ec-tunnel.c @@ -154,7 +154,9 @@ static int ec_i2c_parse_response(const u8 *buf, struct i2c_msg i2c_msgs[], resp = (const struct ec_response_i2c_passthru *)buf; if (resp->i2c_status & EC_I2C_STATUS_TIMEOUT) return -ETIMEDOUT; - else if (resp->i2c_status & EC_I2C_STATUS_ERROR) + else if (resp->i2c_status & EC_I2C_STATUS_NAK) + return -ENXIO; + else if (resp->i2c_status) return -EREMOTEIO; /* Other side could send us back fewer messages, but not more */ @@ -223,7 +225,7 @@ static int ec_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg i2c_msgs[], result = ec_i2c_parse_response(msg->data, i2c_msgs, &num); if (result < 0) { - dev_err(dev, "Error parsing EC i2c message %d\n", result); + dev_dbg(dev, "Error parsing EC i2c message %d\n", result); goto exit; }