Skip to contentSkip to conversation

spi: sirf: replace BUG condition by error code for unsupported transfer

PATCH New Barry Song 2 participants 2 messages Apr 27, 2015 SPI

lore
Share & tools
lore

Barry Song

author
#0 lore raw

PATCH 1/1 spi: sirf: replace BUG condition by error code for unsupported transfer

From: Qipan Li <[email protected]>

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.

---
 drivers/spi/spi-sirf.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/spi/spi-sirf.c +2 -1
index f5715c9..a50ee9b 100644
@@ -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);
Signature · 1 line
1.9.1
maintainer
#1 lore raw

PATCH 1/1 spi: sirf: replace BUG condition by error code for unsupported transfer

Quoted 4 lines · Barry Song

From: Qipan Li <[email protected]>

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.

Applied, thanks.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150427/c1b17b42/attachment-0001.sig>