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: 950742 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 p66I6aJW009640 for ; Wed, 6 Jul 2011 18:08:25 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755200Ab1GFSEa (ORCPT ); Wed, 6 Jul 2011 14:04:30 -0400 Received: from mx1.redhat.com ([209.132.183.28]:65315 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755111Ab1GFSE2 (ORCPT ); Wed, 6 Jul 2011 14:04:28 -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 p66I4RDn023308 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 6 Jul 2011 14:04:27 -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 p66I4D6R027326; Wed, 6 Jul 2011 14:04:26 -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 13/17] [media] dvb-bt8xx: Don't return -EFAULT when a device is not found Message-ID: <20110706150359.28924e4a@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) When a device (or their PCI structs) are not found, the error should be -ENODEV. -EFAULT is reserved for errors while copying arguments from/to userspace. Signed-off-by: Mauro Carvalho Chehab diff --git a/drivers/media/dvb/bt8xx/dvb-bt8xx.c b/drivers/media/dvb/bt8xx/dvb-bt8xx.c index 1e1106d..521d691 100644 --- a/drivers/media/dvb/bt8xx/dvb-bt8xx.c +++ b/drivers/media/dvb/bt8xx/dvb-bt8xx.c @@ -892,7 +892,7 @@ static int __devinit dvb_bt8xx_probe(struct bttv_sub_device *sub) if (!(bttv_pci_dev = bttv_get_pcidev(card->bttv_nr))) { printk("dvb_bt8xx: no pci device for card %d\n", card->bttv_nr); kfree(card); - return -EFAULT; + return -ENODEV; } if (!(card->bt = dvb_bt8xx_878_match(card->bttv_nr, bttv_pci_dev))) { @@ -902,7 +902,7 @@ static int __devinit dvb_bt8xx_probe(struct bttv_sub_device *sub) "installed, try removing it.\n"); kfree(card); - return -EFAULT; + return -ENODEV; } mutex_init(&card->bt->gpio_lock);