diff mbox

spi: bfin5xx: Remove duplicate code to check spi->mode

Message ID 1391395890.4629.1.camel@phoenix (mailing list archive)
State Accepted
Commit 54457fa5bae5e84e2b63d52a7b2d520e7a60f8b8
Headers show

Commit Message

Axel Lin Feb. 3, 2014, 2:51 a.m. UTC
This checking is already done in the implementation of spi_setup().

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 drivers/spi/spi-bfin5xx.c | 4 ----
 1 file changed, 4 deletions(-)

Comments

sonic zhang Feb. 7, 2014, 2:07 a.m. UTC | #1
CC Scott Jiang


>-----Original Message-----

>From: Axel Lin [mailto:axel.lin@ingics.com]

>Sent: Monday, February 03, 2014 10:52 AM

>To: Mark Brown

>Cc: Zhang, Sonic; Steven Miao; linux-spi@vger.kernel.org

>Subject: [PATCH] spi: bfin5xx: Remove duplicate code to check spi->mode

>

>This checking is already done in the implementation of spi_setup().

>

>Signed-off-by: Axel Lin <axel.lin@ingics.com>

>---

> drivers/spi/spi-bfin5xx.c | 4 ----

> 1 file changed, 4 deletions(-)

>

>diff --git a/drivers/spi/spi-bfin5xx.c b/drivers/spi/spi-bfin5xx.c index f0f195a..c6902d2

>100644

>--- a/drivers/spi/spi-bfin5xx.c

>+++ b/drivers/spi/spi-bfin5xx.c

>@@ -1030,10 +1030,6 @@ static int bfin_spi_setup(struct spi_device *spi)

>       }

>

>       /* translate common spi framework into our register */

>-      if (spi->mode & ~(SPI_CPOL | SPI_CPHA | SPI_LSB_FIRST)) {

>-              dev_err(&spi->dev, "unsupported spi modes detected\n");

>-              goto error;

>-      }

>       if (spi->mode & SPI_CPOL)

>               chip->ctl_reg |= BIT_CTL_CPOL;

>       if (spi->mode & SPI_CPHA)

>--

>1.8.1.2

>

>

>
Mark Brown Feb. 14, 2014, 8:18 p.m. UTC | #2
On Mon, Feb 03, 2014 at 10:51:30AM +0800, Axel Lin wrote:
> This checking is already done in the implementation of spi_setup().

Applied, thanks.
diff mbox

Patch

diff --git a/drivers/spi/spi-bfin5xx.c b/drivers/spi/spi-bfin5xx.c
index f0f195a..c6902d2 100644
--- a/drivers/spi/spi-bfin5xx.c
+++ b/drivers/spi/spi-bfin5xx.c
@@ -1030,10 +1030,6 @@  static int bfin_spi_setup(struct spi_device *spi)
 	}
 
 	/* translate common spi framework into our register */
-	if (spi->mode & ~(SPI_CPOL | SPI_CPHA | SPI_LSB_FIRST)) {
-		dev_err(&spi->dev, "unsupported spi modes detected\n");
-		goto error;
-	}
 	if (spi->mode & SPI_CPOL)
 		chip->ctl_reg |= BIT_CTL_CPOL;
 	if (spi->mode & SPI_CPHA)