]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
regmap: spi: Handle async writes of only one buffer
authorMark Brown <broonie@linaro.org>
Thu, 10 Oct 2013 21:25:23 +0000 (22:25 +0100)
committerMark Brown <broonie@linaro.org>
Mon, 14 Oct 2013 21:09:26 +0000 (22:09 +0100)
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 <broonie@linaro.org>
drivers/base/regmap/regmap-spi.c

index 4c506bd940f372b8bbe3b630a9599ca52ea745bf..37f12ae7aadaeadc60005b2bced37ac05bc7210d 100644 (file)
@@ -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;