From: Mark Brown Date: Thu, 10 Oct 2013 21:25:23 +0000 (+0100) Subject: regmap: spi: Handle async writes of only one buffer X-Git-Tag: next-20131017~25^2~3^2~1 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=cd1b9dd0220d3c126b3b61c1f96f0832fc21fc61;p=karo-tx-linux.git regmap: spi: Handle async writes of only one buffer If the value is zero then assume it has been included in the register data and don't send anything, minimising the number of interactions with the hardware. Signed-off-by: Mark Brown --- diff --git a/drivers/base/regmap/regmap-spi.c b/drivers/base/regmap/regmap-spi.c index 4c506bd940f3..37f12ae7aada 100644 --- a/drivers/base/regmap/regmap-spi.c +++ b/drivers/base/regmap/regmap-spi.c @@ -73,7 +73,8 @@ static int regmap_spi_async_write(void *context, spi_message_init(&async->m); spi_message_add_tail(&async->t[0], &async->m); - spi_message_add_tail(&async->t[1], &async->m); + if (val) + spi_message_add_tail(&async->t[1], &async->m); async->m.complete = regmap_spi_complete; async->m.context = async;