From patchwork Sun Jul 27 19:27:30 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 4631231 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 3B8E59F36A for ; Sun, 27 Jul 2014 19:27:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7FFD9200C6 for ; Sun, 27 Jul 2014 19:27:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AB06320149 for ; Sun, 27 Jul 2014 19:27:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752518AbaG0T1s (ORCPT ); Sun, 27 Jul 2014 15:27:48 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:54595 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752281AbaG0T1j (ORCPT ); Sun, 27 Jul 2014 15:27:39 -0400 Received: from [191.255.125.116] (helo=smtp.w2.samsung.com) by bombadil.infradead.org with esmtpsa (Exim 4.80.1 #2 (Red Hat Linux)) id 1XBU6b-0005k0-Fp; Sun, 27 Jul 2014 19:27:37 +0000 Received: from mchehab by smtp.w2.samsung.com with local (Exim 4.80.1) (envelope-from ) id 1XBU6X-0007zs-LL; Sun, 27 Jul 2014 16:27:33 -0300 From: Mauro Carvalho Chehab Cc: Mauro Carvalho Chehab , Linux Media Mailing List , Mauro Carvalho Chehab Subject: [PATCH v3 4/6] cx231xx: handle errors at read_eeprom() Date: Sun, 27 Jul 2014 16:27:30 -0300 Message-Id: <1406489252-30636-5-git-send-email-m.chehab@samsung.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1406489252-30636-1-git-send-email-m.chehab@samsung.com> References: <1406489252-30636-1-git-send-email-m.chehab@samsung.com> To: unlisted-recipients:; (no To-header on input) 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.5 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 Fix the following warnings: drivers/media/usb/cx231xx/cx231xx-cards.c: In function 'read_eeprom': drivers/media/usb/cx231xx/cx231xx-cards.c:979:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable] Signed-off-by: Mauro Carvalho Chehab --- drivers/media/usb/cx231xx/cx231xx-cards.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/media/usb/cx231xx/cx231xx-cards.c b/drivers/media/usb/cx231xx/cx231xx-cards.c index f1cf44af96cf..3f0e309a54d8 100644 --- a/drivers/media/usb/cx231xx/cx231xx-cards.c +++ b/drivers/media/usb/cx231xx/cx231xx-cards.c @@ -991,13 +991,20 @@ static int read_eeprom(struct cx231xx *dev, u8 *eedata, int len) /* start reading at offset 0 */ ret = i2c_transfer(&dev->i2c_bus[1].i2c_adap, &msg_write, 1); + if (ret < 0) { + cx231xx_err("Can't read eeprom\n"); + return ret; + } while (len_todo > 0) { msg_read.len = (len_todo > 64) ? 64 : len_todo; msg_read.buf = eedata_cur; ret = i2c_transfer(&dev->i2c_bus[1].i2c_adap, &msg_read, 1); - + if (ret < 0) { + cx231xx_err("Can't read eeprom\n"); + return ret; + } eedata_cur += msg_read.len; len_todo -= msg_read.len; }