summaryrefslogtreecommitdiff
path: root/drivers/base/regmap
diff options
context:
space:
mode:
authorMark Brown <broonie@linaro.org>2013-10-10 21:25:23 (GMT)
committerMark Brown <broonie@linaro.org>2013-10-14 21:09:26 (GMT)
commitcd1b9dd0220d3c126b3b61c1f96f0832fc21fc61 (patch)
tree5f964cb904c26120d9302f54804d1e7645b15031 /drivers/base/regmap
parent7ccda983931f64e9c89a9b16e6d4adeb92817d96 (diff)
downloadlinux-fsl-qoriq-cd1b9dd0220d3c126b3b61c1f96f0832fc21fc61.tar.xz
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 <broonie@linaro.org>
Diffstat (limited to 'drivers/base/regmap')
-rw-r--r--drivers/base/regmap/regmap-spi.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/base/regmap/regmap-spi.c b/drivers/base/regmap/regmap-spi.c
index 4c506bd..37f12ae 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;