public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH 1/2] spi: dual and quad support(add single macro)
@ 2013-08-30 10:05 wangyuhang
  2013-08-30 10:05 ` [PATCH 2/2] Miss return in patch: commit id:f477b7fb13df2b843997559ff34e87d054ba6538 wangyuhang
  0 siblings, 1 reply; 3+ messages in thread
From: wangyuhang @ 2013-08-30 10:05 UTC (permalink / raw)
  To: broonie, linux-spi, linux-mtd, pekon; +Cc: wangyuhang

fix using default value to specify single mode in patch:
commit id:f477b7fb13df2b843997559ff34e87d054ba6538

Using mode & ~(DUAL | QUAD) to specify SINGLE mode, instead
of using default value in mode. Which means if select neither
DUAL nor QUAD, SINGLE will be in use.

Signed-off-by: wangyuhang <wangyuhang2014@gmail.com>
---
 drivers/spi/spi.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 8d191f2..6653913 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -872,10 +872,15 @@ static void of_register_spi_devices(struct spi_master *master)
 		/* Device DUAL/QUAD mode */
 		prop = of_get_property(nc, "spi-tmax-nbits", &len);
 		if (!prop || len < sizeof(*prop)) {
-			/* set tx mode in SINGLE as default */
+			/*
+			 * set tx mode in SINGLE as default
+			 * if select neither DUAL nor QUAD, regarded as single.
+			 */
+			spi->mode &= ~(SPI_TX_DUAL | SPI_TX_QUAD);
 		} else {
 			switch (be32_to_cpup(prop)) {
 			case SPI_NBITS_SINGLE:
+				spi->mode &= ~(SPI_TX_DUAL | SPI_TX_QUAD);
 				break;
 			case SPI_NBITS_DUAL:
 				spi->mode |= SPI_TX_DUAL;
@@ -893,9 +898,11 @@ static void of_register_spi_devices(struct spi_master *master)
 		prop = of_get_property(nc, "spi-rmax-nbits", &len);
 		if (!prop || len < sizeof(*prop)) {
 			/* set rx mode in SINGLE as default */
+			spi->mode &= ~(SPI_RX_DUAL | SPI_RX_QUAD);
 		} else {
 			switch (be32_to_cpup(prop)) {
 			case SPI_NBITS_SINGLE:
+				spi->mode &= ~(SPI_RX_DUAL | SPI_RX_QUAD);
 				break;
 			case SPI_NBITS_DUAL:
 				spi->mode |= SPI_RX_DUAL;
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] Miss return in patch: commit id:f477b7fb13df2b843997559ff34e87d054ba6538
  2013-08-30 10:05 [PATCH 1/2] spi: dual and quad support(add single macro) wangyuhang
@ 2013-08-30 10:05 ` wangyuhang
  2013-08-30 21:58   ` Mark Brown
  0 siblings, 1 reply; 3+ messages in thread
From: wangyuhang @ 2013-08-30 10:05 UTC (permalink / raw)
  To: broonie, linux-spi, linux-mtd, pekon; +Cc: wangyuhang

Delete a "return" when commit the patch to a new kernel version
 by mistake. So recover it.

Signed-off-by: wangyuhang <wangyuhang2014@gmail.com>
---
 drivers/spi/spi.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 6653913..10584ee 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -1466,6 +1466,7 @@ static int __spi_async(struct spi_device *spi, struct spi_message *message)
 			return -EINVAL;
 		if (xfer->speed_hz && master->max_speed_hz &&
 		    xfer->speed_hz > master->max_speed_hz)
+			return -EINVAL;
 
 		if (xfer->tx_buf && !xfer->tx_nbits)
 			xfer->tx_nbits = SPI_NBITS_SINGLE;
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 2/2] Miss return in patch: commit id:f477b7fb13df2b843997559ff34e87d054ba6538
  2013-08-30 10:05 ` [PATCH 2/2] Miss return in patch: commit id:f477b7fb13df2b843997559ff34e87d054ba6538 wangyuhang
@ 2013-08-30 21:58   ` Mark Brown
  0 siblings, 0 replies; 3+ messages in thread
From: Mark Brown @ 2013-08-30 21:58 UTC (permalink / raw)
  To: wangyuhang; +Cc: linux-mtd, pekon, linux-spi

[-- Attachment #1: Type: text/plain, Size: 315 bytes --]

On Fri, Aug 30, 2013 at 06:05:10PM +0800, wangyuhang wrote:
> Delete a "return" when commit the patch to a new kernel version
>  by mistake. So recover it.

Applied, thanks.

Your commit subject should be in the form "spi: quad: Human readable
text" - I fixed this one up to read:

   spi: quad: Fix missing return

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-08-30 21:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-30 10:05 [PATCH 1/2] spi: dual and quad support(add single macro) wangyuhang
2013-08-30 10:05 ` [PATCH 2/2] Miss return in patch: commit id:f477b7fb13df2b843997559ff34e87d054ba6538 wangyuhang
2013-08-30 21:58   ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox