spi: uniphier: fix zero-length transfer
authorKeiji Hayashibara <hayashibara.keiji@socionext.com>
Wed, 26 Jun 2019 00:41:48 +0000 (09:41 +0900)
committerMark Brown <broonie@kernel.org>
Wed, 26 Jun 2019 11:30:58 +0000 (12:30 +0100)
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>
drivers/spi/spi-uniphier.c

index c3c35c041ef17ef4676c6b3dfaba35a1deec9220..b32c77df5d49cf8acd5c253d9f6965909383e834 100644 (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);