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>
This commit is contained in:
Keiji Hayashibara 2019-06-26 09:41:48 +09:00 committed by Mark Brown
parent e4671df0bf
commit 2b947137f2
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0
1 changed files with 4 additions and 0 deletions

View File

@ -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);