From patchwork Mon May 24 10:57:14 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Mack X-Patchwork-Id: 101858 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o4OAwbMJ010397 for ; Mon, 24 May 2010 10:58:37 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756787Ab0EXK55 (ORCPT ); Mon, 24 May 2010 06:57:57 -0400 Received: from buzzloop.caiaq.de ([212.112.241.133]:53478 "EHLO buzzloop.caiaq.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755542Ab0EXK54 (ORCPT ); Mon, 24 May 2010 06:57:56 -0400 Received: from localhost (localhost [127.0.0.1]) by buzzloop.caiaq.de (Postfix) with ESMTP id 0BD9E7F403C; Mon, 24 May 2010 12:57:53 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at buzzloop.caiaq.de Received: from buzzloop.caiaq.de ([127.0.0.1]) by localhost (buzzloop.caiaq.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GoUhTS0+bMNq; Mon, 24 May 2010 12:57:25 +0200 (CEST) Received: from jup (pd95699b2.dip0.t-ipconnect.de [217.86.153.178]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by buzzloop.caiaq.de (Postfix) with ESMTPSA id 1F9607F4038; Mon, 24 May 2010 12:57:24 +0200 (CEST) From: Daniel Mack To: linux-kernel@vger.kernel.org Cc: Daniel Mack , Wolfram Sang , Mauro Carvalho Chehab , Jiri Slaby , Dmitry Torokhov , Devin Heitmueller , linux-media@vger.kernel.org Subject: [PATCH 1/2] drivers/media/dvb/dvb-usb/dib0700: fix return values Date: Mon, 24 May 2010 12:57:14 +0200 Message-Id: <1274698635-19512-1-git-send-email-daniel@caiaq.de> X-Mailer: git-send-email 1.7.1 In-Reply-To: References: 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.3 (demeter.kernel.org [140.211.167.41]); Mon, 24 May 2010 10:58:37 +0000 (UTC) diff --git a/drivers/media/dvb/dvb-usb/dib0700_core.c b/drivers/media/dvb/dvb-usb/dib0700_core.c index 4f961d2..d2dabac 100644 --- a/drivers/media/dvb/dvb-usb/dib0700_core.c +++ b/drivers/media/dvb/dvb-usb/dib0700_core.c @@ -640,10 +640,10 @@ int dib0700_rc_setup(struct dvb_usb_device *d) return 0; /* Set the IR mode */ - i = dib0700_ctrl_wr(d, rc_setup, 3); - if (i<0) { + i = dib0700_ctrl_wr(d, rc_setup, sizeof(rc_setup)); + if (i < 0) { err("ir protocol setup failed"); - return -1; + return i; } if (st->fw_version < 0x10200) @@ -653,14 +653,14 @@ int dib0700_rc_setup(struct dvb_usb_device *d) purb = usb_alloc_urb(0, GFP_KERNEL); if (purb == NULL) { err("rc usb alloc urb failed\n"); - return -1; + return -ENOMEM; } purb->transfer_buffer = kzalloc(RC_MSG_SIZE_V1_20, GFP_KERNEL); if (purb->transfer_buffer == NULL) { err("rc kzalloc failed\n"); usb_free_urb(purb); - return -1; + return -ENOMEM; } purb->status = -EINPROGRESS; @@ -669,12 +669,10 @@ int dib0700_rc_setup(struct dvb_usb_device *d) dib0700_rc_urb_completion, d); ret = usb_submit_urb(purb, GFP_ATOMIC); - if (ret != 0) { + if (ret) err("rc submit urb failed\n"); - return -1; - } - return 0; + return ret; } static int dib0700_probe(struct usb_interface *intf,