regmap: No multi_write support if bus->write does not exist
authorMarkus Pargmann <mpa@pengutronix.de>
Fri, 21 Aug 2015 08:26:43 +0000 (10:26 +0200)
committerMark Brown <broonie@kernel.org>
Fri, 21 Aug 2015 16:33:43 +0000 (09:33 -0700)
There is no multi_write support available if we cannot use raw_write.
This is the case if bus->write is not implemented.

This patch adds a condition that we need bus and bus->write so that
can_multi_write is true.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/base/regmap/regmap.c

index bc82fd34483b9158d5d7f2e60fb1196007720e27..27456c7978b90135d85f70f9aa110b10946bf32e 100644 (file)
@@ -578,7 +578,7 @@ struct regmap *regmap_init(struct device *dev,
                map->reg_stride = 1;
        map->use_single_read = config->use_single_rw || !bus || !bus->read;
        map->use_single_write = config->use_single_rw || !bus || !bus->write;
-       map->can_multi_write = config->can_multi_write;
+       map->can_multi_write = config->can_multi_write && bus && bus->write;
        map->dev = dev;
        map->bus = bus;
        map->bus_context = bus_context;