mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-12 13:55:32 +00:00
spi: sirf: replace BUG condition by error code for unsupported transfer
return error for unsupported bits-per-word format, BUG() is not right for this scenerios as we are not an ASSERT but an error handler. Signed-off-by: Qipan Li <Qipan.Li@csr.com> Signed-off-by: Barry Song <baohua.song@csr.com> Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
b787f68c36
commit
f08654a2b5
1 changed files with 2 additions and 1 deletions
|
@ -559,7 +559,8 @@ spi_sirfsoc_setup_transfer(struct spi_device *spi, struct spi_transfer *t)
|
|||
sspi->tx_word = spi_sirfsoc_tx_word_u32;
|
||||
break;
|
||||
default:
|
||||
BUG();
|
||||
dev_err(&spi->dev, "bpw %d not supported\n", bits_per_word);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
sspi->word_width = DIV_ROUND_UP(bits_per_word, 8);
|
||||
|
|
Loading…
Reference in a new issue