From patchwork Wed Jul 6 18:03:59 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 950732 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p66I6aJV009640 for ; Wed, 6 Jul 2011 18:08:25 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755111Ab1GFSEb (ORCPT ); Wed, 6 Jul 2011 14:04:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37245 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755243Ab1GFSEa (ORCPT ); Wed, 6 Jul 2011 14:04:30 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p66I4U4N023329 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 6 Jul 2011 14:04:30 -0400 Received: from pedra (vpn1-4-139.ams2.redhat.com [10.36.4.139]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p66I4D6S027326; Wed, 6 Jul 2011 14:04:28 -0400 Date: Wed, 6 Jul 2011 15:03:59 -0300 From: Mauro Carvalho Chehab Cc: Linux Media Mailing List , Linux Kernel Mailing List Subject: [PATCH RFCv3 09/17] [media] nxt6000: i2c bus error should return -EIO Message-ID: <20110706150359.58da172c@pedra> In-Reply-To: References: Mime-Version: 1.0 X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 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-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Wed, 06 Jul 2011 18:08:25 +0000 (UTC) -EFAULT is used to indicate that there were a problem when copying data from/to userspace. Don't mix it with I2C bus error (-EIO). Signed-off-by: Mauro Carvalho Chehab diff --git a/drivers/media/dvb/frontends/nxt6000.c b/drivers/media/dvb/frontends/nxt6000.c index a763ec7..6599b8f 100644 --- a/drivers/media/dvb/frontends/nxt6000.c +++ b/drivers/media/dvb/frontends/nxt6000.c @@ -50,7 +50,7 @@ static int nxt6000_writereg(struct nxt6000_state* state, u8 reg, u8 data) if ((ret = i2c_transfer(state->i2c, &msg, 1)) != 1) dprintk("nxt6000: nxt6000_write error (reg: 0x%02X, data: 0x%02X, ret: %d)\n", reg, data, ret); - return (ret != 1) ? -EFAULT : 0; + return (ret != 1) ? -EIO : 0; } static u8 nxt6000_readreg(struct nxt6000_state* state, u8 reg)