spi/bfin_spi: reject unsupported SPI modes

Who knows what people will try!

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
This commit is contained in:
Mike Frysinger 2010-02-25 10:00:55 +00:00
Родитель a75bd65b21
Коммит 7715aad4ef
1 изменённых файлов: 4 добавлений и 0 удалений

Просмотреть файл

@ -1022,6 +1022,10 @@ static int bfin_spi_setup(struct spi_device *spi)
} }
/* translate common spi framework into our register */ /* 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) if (spi->mode & SPI_CPOL)
chip->ctl_reg |= BIT_CTL_CPOL; chip->ctl_reg |= BIT_CTL_CPOL;
if (spi->mode & SPI_CPHA) if (spi->mode & SPI_CPHA)