Skip to content

Commit

Permalink
spi/bfin_spi: reject unsupported SPI modes
Browse files Browse the repository at this point in the history
Who knows what people will try!

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
  • Loading branch information
Mike Frysinger committed Oct 18, 2010
1 parent a75bd65 commit 7715aad
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/spi/spi_bfin5xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 7715aad

Please sign in to comment.