summaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi_bfin5xx.c
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2010-02-25 10:00:55 +0000
committerMike Frysinger <vapier@gentoo.org>2010-10-18 02:49:41 -0400
commit7715aad4ef5cccb318942a0c47aef8a39d6130d7 (patch)
tree4a77c9f18d5a96f37bd970e1ceffdc5f813f765c /drivers/spi/spi_bfin5xx.c
parenta75bd65b2189d711938d0fa7d9a79df47ddd66fa (diff)
spi/bfin_spi: reject unsupported SPI modes
Who knows what people will try! Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'drivers/spi/spi_bfin5xx.c')
-rw-r--r--drivers/spi/spi_bfin5xx.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/spi/spi_bfin5xx.c b/drivers/spi/spi_bfin5xx.c
index 18b313a5723..a91e556489a 100644
--- a/drivers/spi/spi_bfin5xx.c
+++ b/drivers/spi/spi_bfin5xx.c
@@ -1022,6 +1022,10 @@ 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)