From patchwork Sun Dec 20 02:03:35 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antti Palosaari X-Patchwork-Id: 7891161 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 625569F32E for ; Sun, 20 Dec 2015 02:04:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7CA60201CE for ; Sun, 20 Dec 2015 02:04:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 015C82049D for ; Sun, 20 Dec 2015 02:04:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752390AbbLTCDz (ORCPT ); Sat, 19 Dec 2015 21:03:55 -0500 Received: from mail.kapsi.fi ([217.30.184.167]:44148 "EHLO mail.kapsi.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751068AbbLTCDy (ORCPT ); Sat, 19 Dec 2015 21:03:54 -0500 Received: from [82.128.187.74] (helo=localhost.localdomain.localdomain) by mail.kapsi.fi with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1aATLk-0006sY-3m; Sun, 20 Dec 2015 04:03:52 +0200 From: Antti Palosaari To: linux-media@vger.kernel.org Cc: Antti Palosaari Subject: [PATCH 2/2] rtl2832: print reg number on error case Date: Sun, 20 Dec 2015 04:03:35 +0200 Message-Id: <1450577015-29465-2-git-send-email-crope@iki.fi> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1450577015-29465-1-git-send-email-crope@iki.fi> References: <1450577015-29465-1-git-send-email-crope@iki.fi> X-SA-Exim-Connect-IP: 82.128.187.74 X-SA-Exim-Mail-From: crope@iki.fi X-SA-Exim-Scanned: No (on mail.kapsi.fi); SAEximRunCond expanded to false Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 It is hard to debug possible I2C failures without knowing the possible register itself. Add register number to error printing. Signed-off-by: Antti Palosaari --- drivers/media/dvb-frontends/rtl2832.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/media/dvb-frontends/rtl2832.c b/drivers/media/dvb-frontends/rtl2832.c index 78b87b2..60250cc 100644 --- a/drivers/media/dvb-frontends/rtl2832.c +++ b/drivers/media/dvb-frontends/rtl2832.c @@ -976,7 +976,8 @@ static int rtl2832_regmap_read(void *context, const void *reg_buf, ret = __i2c_transfer(client->adapter, msg, 2); if (ret != 2) { - dev_warn(&client->dev, "i2c reg read failed %d\n", ret); + dev_warn(&client->dev, "i2c reg read failed %d reg %02x\n", + ret, *(u8 *)reg_buf); if (ret >= 0) ret = -EREMOTEIO; return ret; @@ -999,7 +1000,8 @@ static int rtl2832_regmap_write(void *context, const void *data, size_t count) ret = __i2c_transfer(client->adapter, msg, 1); if (ret != 1) { - dev_warn(&client->dev, "i2c reg write failed %d\n", ret); + dev_warn(&client->dev, "i2c reg write failed %d reg %02x\n", + ret, *(u8 *)data); if (ret >= 0) ret = -EREMOTEIO; return ret; @@ -1028,7 +1030,8 @@ static int rtl2832_regmap_gather_write(void *context, const void *reg, ret = __i2c_transfer(client->adapter, msg, 1); if (ret != 1) { - dev_warn(&client->dev, "i2c reg write failed %d\n", ret); + dev_warn(&client->dev, "i2c reg write failed %d reg %02x\n", + ret, *(u8 const *)reg); if (ret >= 0) ret = -EREMOTEIO; return ret;