From patchwork Thu Sep 16 07:04:20 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Leroy X-Patchwork-Id: 184712 Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o8G74x27014867 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 16 Sep 2010 07:05:35 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 1Ow8We-0001LI-5g; Thu, 16 Sep 2010 07:04:56 +0000 Received: from sog-mx-3.v43.ch3.sourceforge.com ([172.29.43.193] helo=mx.sourceforge.net) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1Ow8Wc-0001LD-SL for spi-devel-general@lists.sourceforge.net; Thu, 16 Sep 2010 07:04:54 +0000 X-ACL-Warn: Received: from pegase1.c-s.fr ([194.2.40.7] helo=mailhub1.si.c-s.fr) by sog-mx-3.v43.ch3.sourceforge.com with esmtp (Exim 4.69) id 1Ow8Wb-0008B0-Gb for spi-devel-general@lists.sourceforge.net; Thu, 16 Sep 2010 07:04:54 +0000 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id ECCE21C8133; Thu, 16 Sep 2010 09:04:47 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from mailhub1.si.c-s.fr ([192.168.12.234]) by localhost (mailhub1.c-s.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id L17+CnIAaL5Q; Thu, 16 Sep 2010 09:04:47 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id D621E1C8122; Thu, 16 Sep 2010 09:04:47 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id BC563C7393; Thu, 16 Sep 2010 09:04:47 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id UKnetPQAoPYe; Thu, 16 Sep 2010 09:04:47 +0200 (CEST) Received: from unknown (unknown [172.25.231.36]) by messagerie.si.c-s.fr (Postfix) with SMTP id 95083C7391; Thu, 16 Sep 2010 09:04:20 +0200 (CEST) Subject: [PATCH] spi_mpc8xxx: fix writing to adress 0 From: christophe leroy To: David Brownell , Grant Likely , spi-devel-general@lists.sourceforge.net, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Message-Id: <20100916070420.95083C7391@messagerie.si.c-s.fr> Date: Thu, 16 Sep 2010 09:04:20 +0200 (CEST) X-Spam-Score: 0.3 (/) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain 0.3 AWL AWL: From: address is in the auto white-list X-Headers-End: 1Ow8Wb-0008B0-Gb 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 (demeter1.kernel.org [140.211.167.41]); Thu, 16 Sep 2010 07:05:35 +0000 (UTC) diff -urN a/drivers/spi/spi_mpc8xxx.c b/drivers/spi/spi_mpc8xxx.c --- a/drivers/spi/spi_mpc8xxx.c 2010-09-08 16:42:30.000000000 +0200 +++ b/drivers/spi/spi_mpc8xxx.c 2010-09-08 16:43:50.000000000 +0200 @@ -438,7 +438,7 @@ dev_err(dev, "unable to map tx dma\n"); return -ENOMEM; } - } else { + } else if (t->tx_buf) { mspi->tx_dma = t->tx_dma; } @@ -449,7 +449,7 @@ dev_err(dev, "unable to map rx dma\n"); goto err_rx_dma; } - } else { + } else if (t->rx_buf) { mspi->rx_dma = t->rx_dma; }