From patchwork Sun Nov 8 21:28:55 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TsOpbWV0aCBNw6FydG9u?= X-Patchwork-Id: 2027 Return-path: Envelope-to: mchehab@infradead.org Delivery-date: Sun, 08 Nov 2009 21:29:20 +0000 Received: from bombadil.infradead.org [18.85.46.34] by pedra.chehab.org with IMAP (fetchmail-6.3.6) for (single-drop); Sun, 08 Nov 2009 19:31:18 -0200 (BRST) Received: from vger.kernel.org ([209.132.176.167]) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1N7FK4-00043g-E1; Sun, 08 Nov 2009 21:29:20 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755360AbZKHV3H (ORCPT + 1 other); Sun, 8 Nov 2009 16:29:07 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755348AbZKHV3G (ORCPT ); Sun, 8 Nov 2009 16:29:06 -0500 Received: from mail02d.mail.t-online.hu ([84.2.42.7]:60376 "EHLO mail02d.mail.t-online.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755347AbZKHV3E (ORCPT ); Sun, 8 Nov 2009 16:29:04 -0500 Received: from [192.168.1.64] (dsl5402C46E.pool.t-online.hu [84.2.196.110]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail02d.mail.t-online.hu (Postfix) with ESMTPSA id 3422A758749; Sun, 8 Nov 2009 22:28:49 +0100 (CET) Message-ID: <4AF73817.1030605@freemail.hu> Date: Sun, 08 Nov 2009 22:28:55 +0100 From: =?UTF-8?B?TsOpbWV0aCBNw6FydG9u?= User-Agent: Mozilla/5.0 (X11; U; Linux i686; hu-HU; rv:1.8.1.21) Gecko/20090402 SeaMonkey/1.1.16 MIME-Version: 1.0 To: Hans de Goede , Jean-Francois Moine , V4L Mailing List Subject: [PATCH] gspca pac7311: stop sending URBs on first error References: <4AF6BA5C.9030304@freemail.hu> In-Reply-To: <4AF6BA5C.9030304@freemail.hu> X-DCC-mail.t-online.hu-Metrics: mail02d.mail.t-online.hu 32721; Body=3 Fuz1=3 Fuz2=3 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Márton Németh It is no use to continue sending URBs if one of them already failed. Signed-off-by: Márton Németh --- The patch is based on 13335:3fd924da7091 from http://linuxtv.org/hg/~jfrancois/gspca/ . --- -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff -r 3fd924da7091 linux/drivers/media/video/gspca/pac7311.c --- a/linux/drivers/media/video/gspca/pac7311.c Sun Nov 08 08:41:28 2009 +0100 +++ b/linux/drivers/media/video/gspca/pac7311.c Sun Nov 08 23:14:13 2009 +0100 @@ -590,16 +590,27 @@ static void sd_stopN(struct gspca_dev *gspca_dev) { - reg_w(gspca_dev, 0xff, 0x04); - reg_w(gspca_dev, 0x27, 0x80); - reg_w(gspca_dev, 0x28, 0xca); - reg_w(gspca_dev, 0x29, 0x53); - reg_w(gspca_dev, 0x2a, 0x0e); - reg_w(gspca_dev, 0xff, 0x01); - reg_w(gspca_dev, 0x3e, 0x20); - reg_w(gspca_dev, 0x78, 0x44); /* Bit_0=start stream, Bit_6=LED */ - reg_w(gspca_dev, 0x78, 0x44); /* Bit_0=start stream, Bit_6=LED */ - reg_w(gspca_dev, 0x78, 0x44); /* Bit_0=start stream, Bit_6=LED */ + int ret; + + ret = reg_w(gspca_dev, 0xff, 0x04); + if (0 <= ret) + ret = reg_w(gspca_dev, 0x27, 0x80); + if (0 <= ret) + ret = reg_w(gspca_dev, 0x28, 0xca); + if (0 <= ret) + ret = reg_w(gspca_dev, 0x29, 0x53); + if (0 <= ret) + ret = reg_w(gspca_dev, 0x2a, 0x0e); + if (0 <= ret) + ret = reg_w(gspca_dev, 0xff, 0x01); + if (0 <= ret) + ret = reg_w(gspca_dev, 0x3e, 0x20); + if (0 <= ret) + ret = reg_w(gspca_dev, 0x78, 0x44); /* Bit_0=start stream, Bit_6=LED */ + if (0 <= ret) + ret = reg_w(gspca_dev, 0x78, 0x44); /* Bit_0=start stream, Bit_6=LED */ + if (0 <= ret) + ret = reg_w(gspca_dev, 0x78, 0x44); /* Bit_0=start stream, Bit_6=LED */ } /* called on streamoff with alt 0 and on disconnect for 7311 */