summaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi-sirf.c
diff options
context:
space:
mode:
authorQipan Li <Qipan.Li@csr.com>2015-04-27 09:22:28 +0000
committerMark Brown <broonie@kernel.org>2015-04-27 20:53:28 +0100
commitf08654a2b582b4e48e8a4a3d2c5c98832adc4387 (patch)
tree1a23f77e44c2c256f0fcbdc61c094610c37e1a49 /drivers/spi/spi-sirf.c
parentb787f68c36d49bb1d9236f403813641efa74a031 (diff)
downloadlinux-f08654a2b582b4e48e8a4a3d2c5c98832adc4387.tar.gz
linux-f08654a2b582b4e48e8a4a3d2c5c98832adc4387.tar.bz2
linux-f08654a2b582b4e48e8a4a3d2c5c98832adc4387.zip
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>
Diffstat (limited to 'drivers/spi/spi-sirf.c')
-rw-r--r--drivers/spi/spi-sirf.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/spi/spi-sirf.c b/drivers/spi/spi-sirf.c
index f5715c9f68b0..a50ee9b644ae 100644
--- a/drivers/spi/spi-sirf.c
+++ b/drivers/spi/spi-sirf.c
@@ -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);