From patchwork Fri Jul 2 15:30:17 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Niebuhr X-Patchwork-Id: 109905 Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o62FUqAa006895 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 2 Jul 2010 15:31:28 GMT Received: from localhost ([127.0.0.1] helo=sfs-ml-3.v29.ch3.sourceforge.com) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1OUiCZ-00085h-QA; Fri, 02 Jul 2010 15:30:51 +0000 Received: from sfi-mx-2.v28.ch3.sourceforge.com ([172.29.28.122] helo=mx.sourceforge.net) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1OUiCY-00085Z-Ki for spi-devel-general@lists.sourceforge.net; Fri, 02 Jul 2010 15:30:50 +0000 Received-SPF: pass (sfi-mx-2.v28.ch3.sourceforge.com: domain of gmail.com designates 74.125.83.47 as permitted sender) client-ip=74.125.83.47; envelope-from=bniebuhr3@gmail.com; helo=mail-gw0-f47.google.com; Received: from mail-gw0-f47.google.com ([74.125.83.47]) by sfi-mx-2.v28.ch3.sourceforge.com with esmtp (Exim 4.69) id 1OUiCX-0000Dl-S0 for spi-devel-general@lists.sourceforge.net; Fri, 02 Jul 2010 15:30:50 +0000 Received: by gwj18 with SMTP id 18so2440631gwj.34 for ; Fri, 02 Jul 2010 08:30:44 -0700 (PDT) Received: by 10.100.95.8 with SMTP id s8mr943190anb.248.1278084644387; Fri, 02 Jul 2010 08:30:44 -0700 (PDT) Received: from localhost.localdomain (h197.252.190.173.static.ip.windstream.net [173.190.252.197]) by mx.google.com with ESMTPS id x3sm962170ybl.23.2010.07.02.08.30.42 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 02 Jul 2010 08:30:43 -0700 (PDT) From: Brian Niebuhr To: spi-devel-general@lists.sourceforge.net Date: Fri, 2 Jul 2010 10:30:17 -0500 Message-Id: <1278084617-23027-1-git-send-email-bniebuhr@efjohnson.com> X-Mailer: git-send-email 1.6.3.3 X-Spam-Score: -1.5 (-) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain -0.0 SPF_PASS SPF: sender matches SPF record -0.0 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.0 DKIM_SIGNED Domain Keys Identified Mail: message has a signature X-Headers-End: 1OUiCX-0000Dl-S0 Cc: david-b@pacbell.net Subject: [spi-devel-general] [PATCH] spi: bitbang: reinitialize transfer parameters for every message X-BeenThere: spi-devel-general@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: Linux SPI core/device drivers discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: spi-devel-general-bounces@lists.sourceforge.net X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Fri, 02 Jul 2010 15:31:29 +0000 (UTC) diff --git a/drivers/spi/spi_bitbang.c b/drivers/spi/spi_bitbang.c index 5265330..8b55724 100644 --- a/drivers/spi/spi_bitbang.c +++ b/drivers/spi/spi_bitbang.c @@ -259,7 +259,6 @@ static void bitbang_work(struct work_struct *work) struct spi_bitbang *bitbang = container_of(work, struct spi_bitbang, work); unsigned long flags; - int do_setup = -1; int (*setup_transfer)(struct spi_device *, struct spi_transfer *); @@ -275,6 +274,7 @@ static void bitbang_work(struct work_struct *work) unsigned tmp; unsigned cs_change; int status; + int do_setup = -1; m = container_of(bitbang->queue.next, struct spi_message, queue); @@ -307,6 +307,8 @@ static void bitbang_work(struct work_struct *work) status = setup_transfer(spi, t); if (status < 0) break; + if (do_setup == -1) + do_setup = 0; } /* set up default clock polarity, and activate chip; @@ -367,11 +369,6 @@ static void bitbang_work(struct work_struct *work) m->status = status; m->complete(m->context); - /* restore speed and wordsize if it was overridden */ - if (do_setup == 1) - setup_transfer(spi, NULL); - do_setup = 0; - /* normally deactivate chipselect ... unless no error and * cs_change has hinted that the next message will probably * be for this chip too.