lkml.org 
[lkml]   [2019]   [Jun]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/2] spi: uniphier: fix zero-length transfer
Date
The zero-length transfer results in timeout error because
the transfer doesn't start.
This commit modified to return success in this case.

Signed-off-by: Keiji Hayashibara <hayashibara.keiji@socionext.com>
---
drivers/spi/spi-uniphier.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/drivers/spi/spi-uniphier.c b/drivers/spi/spi-uniphier.c
index c3c35c0..b32c77d 100644
--- a/drivers/spi/spi-uniphier.c
+++ b/drivers/spi/spi-uniphier.c
@@ -331,6 +331,10 @@ static int uniphier_spi_transfer_one(struct spi_master *master,
struct device *dev = master->dev.parent;
unsigned long time_left;

+ /* Terminate and return success for 0 byte length transfer */
+ if (!t->len)
+ return 0;
+
uniphier_spi_setup_transfer(spi, t);

reinit_completion(&priv->xfer_done);
--
2.7.4
\
 
 \ /
  Last update: 2019-06-26 02:42    [W:0.041 / U:5.436 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site