From patchwork Mon Dec 7 12:50:30 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Nikitenko X-Patchwork-Id: 65507 Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nB7CoHcp016294 for ; Mon, 7 Dec 2009 12:50:17 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 1NHd2d-0005ob-Ow; Mon, 07 Dec 2009 12:50:15 +0000 Received: from sfi-mx-3.v28.ch3.sourceforge.com ([172.29.28.123] helo=mx.sourceforge.net) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1NHd2c-0005oU-FL for spi-devel-general@lists.sourceforge.net; Mon, 07 Dec 2009 12:50:14 +0000 Received-SPF: pass (sfi-mx-3.v28.ch3.sourceforge.com: domain of gmail.com designates 209.85.218.212 as permitted sender) client-ip=209.85.218.212; envelope-from=jan.nikitenko@gmail.com; helo=mail-bw0-f212.google.com; Received: from mail-bw0-f212.google.com ([209.85.218.212]) by sfi-mx-3.v28.ch3.sourceforge.com with esmtp (Exim 4.69) id 1NHd2Y-0004JZ-2j for spi-devel-general@lists.sourceforge.net; Mon, 07 Dec 2009 12:50:14 +0000 Received: by bwz4 with SMTP id 4so3643809bwz.2 for ; Mon, 07 Dec 2009 04:50:03 -0800 (PST) Received: by 10.204.154.207 with SMTP id p15mr6802671bkw.202.1260190203427; Mon, 07 Dec 2009 04:50:03 -0800 (PST) Received: from localhost ([193.179.131.38]) by mx.google.com with ESMTPS id 19sm840003fkr.18.2009.12.07.04.50.02 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 07 Dec 2009 04:50:02 -0800 (PST) Date: Mon, 7 Dec 2009 13:50:30 +0100 From: Jan Nikitenko To: David Brownell Message-ID: <20091207125030.GA24967@localhost.localdomain> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.16 (2007-06-09) 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: 1NHd2Y-0004JZ-2j Cc: spi-devel-general@lists.sourceforge.net Subject: [spi-devel-general] [PATCH] au1550_spi: fix setupxfer not to override cfg with zeros 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: , Errors-To: spi-devel-general-bounces@lists.sourceforge.net diff --git a/drivers/spi/au1550_spi.c b/drivers/spi/au1550_spi.c index 76cbc1a..cfd5ff9 100644 --- a/drivers/spi/au1550_spi.c +++ b/drivers/spi/au1550_spi.c @@ -237,8 +237,14 @@ static int au1550_spi_setupxfer(struct spi_device *spi, struct spi_transfer *t) unsigned bpw, hz; u32 cfg, stat; - bpw = t ? t->bits_per_word : spi->bits_per_word; - hz = t ? t->speed_hz : spi->max_speed_hz; + bpw = spi->bits_per_word; + hz = spi->max_speed_hz; + if (t) { + if (t->bits_per_word) + bpw = t->bits_per_word; + if (t->speed_hz) + hz = t->speed_hz; + } if (bpw < 4 || bpw > 24) { dev_err(&spi->dev, "setupxfer: invalid bits_per_word=%d\n",