[PATCH] spi: renesas_rpc_spi: Return -ENOTSUPP if bitlen cannot be handled during xfer
Lad Prabhakar
prabhakar.mahadev-lad.rj at bp.renesas.com
Wed Sep 23 12:07:04 CEST 2020
Return -ENOTSUPP if bitlen cannot be handled by the controller
during xfer.
This fixes board reset when sspi command is hit with no arguments
where bitlen is passed as 0.
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj at bp.renesas.com>
Reviewed-by: Biju Das <biju.das.jz at bp.renesas.com>
---
drivers/spi/renesas_rpc_spi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/spi/renesas_rpc_spi.c b/drivers/spi/renesas_rpc_spi.c
index 9d9e767d87..c2ff5b157c 100644
--- a/drivers/spi/renesas_rpc_spi.c
+++ b/drivers/spi/renesas_rpc_spi.c
@@ -252,7 +252,7 @@ static int rpc_spi_xfer(struct udevice *dev, unsigned int bitlen,
if (!priv->cmdstarted) {
if (!wlen || rlen)
- BUG();
+ return -ENOTSUPP;
memcpy(priv->cmdcopy, dout, wlen);
priv->cmdlen = wlen;
--
2.17.1
More information about the U-Boot
mailing list