From patchwork Tue May 5 16:54:16 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olli Salonen X-Patchwork-Id: 6339901 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 951C6BEEE5 for ; Tue, 5 May 2015 16:54:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D1B90201F2 for ; Tue, 5 May 2015 16:54:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5631E20265 for ; Tue, 5 May 2015 16:54:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030533AbbEEQyq (ORCPT ); Tue, 5 May 2015 12:54:46 -0400 Received: from mail-lb0-f175.google.com ([209.85.217.175]:34804 "EHLO mail-lb0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761109AbbEEQyn (ORCPT ); Tue, 5 May 2015 12:54:43 -0400 Received: by lbcga7 with SMTP id ga7so133648645lbc.1 for ; Tue, 05 May 2015 09:54:42 -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=gZagXGabbu6LGpGoOlIhtsIwDoyhMgAwn9UTScBBXko=; b=OtJ7wJQdMAVfrYw3ooK8cxejyl2iWWkcEmli3v9EcZ+cnGZ2rkIT6qWlAbHk5kKCeu T4hhD8ETYBy7s5Vvh6WUiG/NbBKklOF0LBUVWN4DIq/R7hnsaq8A2Bj1koh2JYjFfpwd 7pSK2MCAqYdRyrnxYm3lelXRXRe7KTr+isHoEDdB7LYgDTbjxnq5awZ8mceG5RdTPCup +Ca3yT92TQkTxY10j+wcI+aO8pgmAQnx05oFRaihdsHnDh4x1+S8OcQQrTN/M6GiP8AP 1RVcR+10QjKyvsZT1C/C2E/apH6OXoIFO88Vj7BgcZxUEQCdIvuLuoqhw2aHNB+X+fj+ wIsg== X-Gm-Message-State: ALoCoQlcYL8TcGqluVSMgkd2BTm4vbHZKxEpP4E+y1d1qF/yql8Sqe11MxTX/eVwDfRLH4wcnYDt X-Received: by 10.112.16.196 with SMTP id i4mr24576803lbd.72.1430844882305; Tue, 05 May 2015 09:54:42 -0700 (PDT) Received: from dl160.lan (188-67-118-178.bb.dnainternet.fi. [188.67.118.178]) by mx.google.com with ESMTPSA id z1sm4177919laz.48.2015.05.05.09.54.40 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 05 May 2015 09:54:41 -0700 (PDT) From: Olli Salonen To: linux-media@vger.kernel.org Cc: Olli Salonen Subject: [PATCH v4 3/6] si2168: add I2C error handling Date: Tue, 5 May 2015 19:54:16 +0300 Message-Id: <1430844859-24947-4-git-send-email-olli.salonen@iki.fi> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1430844859-24947-1-git-send-email-olli.salonen@iki.fi> References: <1430844859-24947-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=-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 Return error from si2168_cmd_execute in case the demodulator returns an error. Signed-off-by: Olli Salonen --- drivers/media/dvb-frontends/si2168.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/media/dvb-frontends/si2168.c b/drivers/media/dvb-frontends/si2168.c index 29a5936..b68ab34 100644 --- a/drivers/media/dvb-frontends/si2168.c +++ b/drivers/media/dvb-frontends/si2168.c @@ -60,6 +60,12 @@ static int si2168_cmd_execute(struct i2c_client *client, struct si2168_cmd *cmd) jiffies_to_msecs(jiffies) - (jiffies_to_msecs(timeout) - TIMEOUT)); + /* error bit set? */ + if ((cmd->args[0] >> 6) & 0x01) { + ret = -EREMOTEIO; + goto err_mutex_unlock; + } + if (!((cmd->args[0] >> 7) & 0x01)) { ret = -ETIMEDOUT; goto err_mutex_unlock;