From patchwork Tue Aug 7 02:46:57 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Devin Heitmueller X-Patchwork-Id: 1282541 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 00469DF288 for ; Tue, 7 Aug 2012 02:47:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932512Ab2HGCry (ORCPT ); Mon, 6 Aug 2012 22:47:54 -0400 Received: from mail-vc0-f174.google.com ([209.85.220.174]:52727 "EHLO mail-vc0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932480Ab2HGCrx (ORCPT ); Mon, 6 Aug 2012 22:47:53 -0400 Received: by mail-vc0-f174.google.com with SMTP id fk26so3432709vcb.19 for ; Mon, 06 Aug 2012 19:47:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=qHoJI32AceIgqd6sqUsrl2+PX1eTLG1xJnJb5+AowYo=; b=DDpkuIzKEId8lIYOT/ucSfEbbnOIOiLKxzbPjBNY56eu8VsE29esS9YBd/zTJJ2EJd THLlDM5Tlw02lMG3HG8GkuSSXSlYpK84wip/CvkNJzw/L9YiLXAeelUEVyrcAeqfGAOi eHA1t0gixyEhMIx0GsW1cuJ8VugH9OE0uVZZhS3YLbYBJTpC9yP3YCRMWIVp6batp9Jg dLfi/1tRzAemDj1plUoy3sQ3E8TXihYIlhpe+u2GNKQziXFdgJDYBIPQpJwW+zMj36qL y+4SnwBocvYSLSrRKdiy9YZaFyBG3XBnn2A/Ckci4APEi7qWM2GoUA/jUt3zK0Bz0B9h 1n8Q== Received: by 10.52.21.99 with SMTP id u3mr8468944vde.56.1344307672823; Mon, 06 Aug 2012 19:47:52 -0700 (PDT) Received: from localhost.localdomain (pool-108-54-72-165.nycmny.fios.verizon.net. [108.54.72.165]) by mx.google.com with ESMTPS id e9sm17555638vdf.21.2012.08.06.19.47.51 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 06 Aug 2012 19:47:52 -0700 (PDT) From: Devin Heitmueller To: linux-media@vger.kernel.org Cc: Devin Heitmueller Subject: [PATCH 07/24] xc5000: properly report i2c write failures Date: Mon, 6 Aug 2012 22:46:57 -0400 Message-Id: <1344307634-11673-8-git-send-email-dheitmueller@kernellabs.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1344307634-11673-1-git-send-email-dheitmueller@kernellabs.com> References: <1344307634-11673-1-git-send-email-dheitmueller@kernellabs.com> X-Gm-Message-State: ALoCoQlLvLr6Ff6AJXlP2YAFQP6EWmS1PbWxzohhkvRjtCYCOqxhgjca4oZUPRG9Ur/teHw+CkI0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The logic as written would *never* actually return an error condition, since the loop would run until the counter hit zero but the check was for a value less than zero. Signed-off-by: Devin Heitmueller --- drivers/media/common/tuners/xc5000.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/media/common/tuners/xc5000.c b/drivers/media/common/tuners/xc5000.c index f660e33..a7fa17e 100644 --- a/drivers/media/common/tuners/xc5000.c +++ b/drivers/media/common/tuners/xc5000.c @@ -341,7 +341,7 @@ static int xc_write_reg(struct xc5000_priv *priv, u16 regAddr, u16 i2cData) } } } - if (WatchDogTimer < 0) + if (WatchDogTimer <= 0) result = XC_RESULT_I2C_WRITE_FAILURE; return result;