From patchwork Tue Sep 22 18:34:29 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Andrzej Siewior X-Patchwork-Id: 49384 X-Patchwork-Delegate: dougsland@redhat.com Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n8MIYV0A013947 for ; Tue, 22 Sep 2009 18:34:31 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751017AbZIVSe1 (ORCPT ); Tue, 22 Sep 2009 14:34:27 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1750992AbZIVSe1 (ORCPT ); Tue, 22 Sep 2009 14:34:27 -0400 Received: from Chamillionaire.breakpoint.cc ([85.10.199.196]:49489 "EHLO Chamillionaire.breakpoint.cc" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750963AbZIVSe0 (ORCPT ); Tue, 22 Sep 2009 14:34:26 -0400 Received: id: bigeasy by Chamillionaire.breakpoint.cc with local (easymta 1.00 BETA 1) id 1MqAC5-0002G3-DB; Tue, 22 Sep 2009 20:34:29 +0200 Date: Tue, 22 Sep 2009 20:34:29 +0200 From: Sebastian Andrzej Siewior To: Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, Vaibhav Hiremath , Roel Kluin Subject: [PATCH] media/tvp514x: recognize the error case in tvp514x_read_reg() Message-ID: <20090922183429.GA8585@Chamillionaire.breakpoint.cc> MIME-Version: 1.0 Content-Disposition: inline X-Key-Id: FE3F4706 X-Key-Fingerprint: FFDA BBBB 3563 1B27 75C9 925B 98D5 5C1C FE3F 4706 User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Sebastian Andrzej Siewior i2c_smbus_read_byte_data() returns a negative value on error. It is very likely to be != -1 (-EPERM). Signed-off-by: Sebastian Andrzej Siewior --- Noticed by strange results during signal beeing pending. drivers/media/video/tvp514x.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/media/video/tvp514x.c b/drivers/media/video/tvp514x.c index 2443726..26b4e71 100644 --- a/drivers/media/video/tvp514x.c +++ b/drivers/media/video/tvp514x.c @@ -272,7 +272,7 @@ static int tvp514x_read_reg(struct v4l2_subdev *sd, u8 reg) read_again: err = i2c_smbus_read_byte_data(client, reg); - if (err == -1) { + if (err < 0) { if (retry <= I2C_RETRY_COUNT) { v4l2_warn(sd, "Read: retry ... %d\n", retry); retry++;