From patchwork Mon Sep 29 07:44:18 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olli Salonen X-Patchwork-Id: 4994101 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 38D539F2BA for ; Mon, 29 Sep 2014 07:44:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 659FE20220 for ; Mon, 29 Sep 2014 07:44:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6C9FF201FA for ; Mon, 29 Sep 2014 07:44:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751753AbaI2Hox (ORCPT ); Mon, 29 Sep 2014 03:44:53 -0400 Received: from mail-lb0-f178.google.com ([209.85.217.178]:34639 "EHLO mail-lb0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751714AbaI2Hox (ORCPT ); Mon, 29 Sep 2014 03:44:53 -0400 Received: by mail-lb0-f178.google.com with SMTP id w7so606570lbi.37 for ; Mon, 29 Sep 2014 00:44:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=L/bF7ILDcf25FJO8Om6/v+nNXCRwdYyk41Ez4GbYOpE=; b=atto5D6JvXSQu94R8RDmR3YwFjhs5syOzWuPgW0QoLqsBqwcCB4dyvf+ZpsWv8jvDl j1fktJs65k1rcsqXT8SzHzuTDHGF3as2H7lJKQnzczPiOIqsmk8E3pLvda2FvkQf8q81 5EhEkeBZCGUPhYQXxLhAQgV8bKtcgOjjhnGrvTHpgf1P61dxseCRKR8fmTcVqEg0TJWQ wuT92J2nkWmsfxT7jFiLgIy19DngGIJWkvEcr3C1yRV8pUIDRM7B4y8MJ8v5bpLeyi1l d7jFLTlxmQpOK1EkHzsVEW8GPhhS6Qwgxbc+tp1FCfgu2dC3lVGuFq6YASQqw8Ea8ZwN Q8Ow== X-Gm-Message-State: ALoCoQk/0PRPLZTrdLqByK1mInu3zwmj2TZsX3p8FZz4xxkwQE4LZQU+zDxYdk4Ru2lQn/x7cnrq X-Received: by 10.112.198.228 with SMTP id jf4mr35438551lbc.35.1411976691709; Mon, 29 Sep 2014 00:44:51 -0700 (PDT) Received: from devlin.trsqr.net (dsl-espbrasgw1-54f9ca-144.dhcp.inet.fi. [84.249.202.144]) by mx.google.com with ESMTPSA id o4sm4556112lao.32.2014.09.29.00.44.50 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 29 Sep 2014 00:44:51 -0700 (PDT) From: Olli Salonen To: linux-media@vger.kernel.org Cc: Olli Salonen Subject: [PATCH 3/5] sp2: improve debug logging Date: Mon, 29 Sep 2014 10:44:18 +0300 Message-Id: <1411976660-19329-3-git-send-email-olli.salonen@iki.fi> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1411976660-19329-1-git-send-email-olli.salonen@iki.fi> References: <1411976660-19329-1-git-send-email-olli.salonen@iki.fi> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 Improve debugging output. Signed-off-by: Olli Salonen Reviewed-by: Antti Palosaari --- drivers/media/dvb-frontends/sp2.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/drivers/media/dvb-frontends/sp2.c b/drivers/media/dvb-frontends/sp2.c index 1f4f250..320cbe9 100644 --- a/drivers/media/dvb-frontends/sp2.c +++ b/drivers/media/dvb-frontends/sp2.c @@ -92,6 +92,9 @@ static int sp2_write_i2c(struct sp2 *s, u8 reg, u8 *buf, int len) return -EIO; } + dev_dbg(&s->client->dev, "addr=0x%04x, reg = 0x%02x, data = %*ph\n", + client->addr, reg, len, buf); + return 0; } @@ -103,9 +106,6 @@ static int sp2_ci_op_cam(struct dvb_ca_en50221 *en50221, int slot, u8 acs, int mem, ret; int (*ci_op_cam)(void*, u8, int, u8, int*) = s->ci_control; - dev_dbg(&s->client->dev, "slot=%d, acs=0x%02x, addr=0x%04x, data = 0x%02x", - slot, acs, addr, data); - if (slot != 0) return -EINVAL; @@ -140,13 +140,16 @@ static int sp2_ci_op_cam(struct dvb_ca_en50221 *en50221, int slot, u8 acs, if (ret) return ret; - if (read) { - dev_dbg(&s->client->dev, "cam read, addr=0x%04x, data = 0x%04x", - addr, mem); + dev_dbg(&s->client->dev, "%s: slot=%d, addr=0x%04x, %s, data=%x", + (read) ? "read" : "write", slot, addr, + (acs == SP2_CI_ATTR_ACS) ? "attr" : "io", + (read) ? mem : data); + + if (read) return mem; - } else { + else return 0; - } + } int sp2_ci_read_attribute_mem(struct dvb_ca_en50221 *en50221,