From 7715aad4ef5cccb318942a0c47aef8a39d6130d7 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Thu, 25 Feb 2010 10:00:55 +0000 Subject: spi/bfin_spi: reject unsupported SPI modes Who knows what people will try! Signed-off-by: Mike Frysinger --- drivers/spi/spi_bfin5xx.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'drivers/spi') diff --git a/drivers/spi/spi_bfin5xx.c b/drivers/spi/spi_bfin5xx.c index 18b313a57236..a91e556489a9 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) -- cgit v1.2.2