summaryrefslogtreecommitdiff
path: root/drivers/spi
diff options
context:
space:
mode:
authorKeiji Hayashibara <hayashibara.keiji@socionext.com>2019-06-26 03:41:48 +0300
committerMark Brown <broonie@kernel.org>2019-06-26 14:30:58 +0300
commit2b947137f2b8f77474dfe77d68c52778bf6ae453 (patch)
tree3daf0a519b81c71aa9a59968cbc537067e787460 /drivers/spi
parente4671df0bfd67d4864de014fa1751d5e2a56c7a6 (diff)
downloadlinux-2b947137f2b8f77474dfe77d68c52778bf6ae453.tar.xz
spi: uniphier: fix zero-length transfer
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> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/spi-uniphier.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/spi/spi-uniphier.c b/drivers/spi/spi-uniphier.c
index c3c35c041ef1..b32c77df5d49 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);