diff options
author | Markus Pargmann <mpa@pengutronix.de> | 2015-08-12 12:12:33 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-08-14 19:07:39 +0100 |
commit | 07ea400e1b26726f21b2c2299d187d6eb7eb4324 (patch) | |
tree | 35313c14111c2f8d7bb710684646803c6547b07c /drivers/base/regmap | |
parent | bc0195aad0daa2ad5b0d76cce22b167bc3435590 (diff) |
regmap: Fix regmap_can_raw_write check
This function is missing a check if map->bus->write is implemented. If
it is not implemented arbitrary raw writes are not possible.
Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/base/regmap')
-rw-r--r-- | drivers/base/regmap/regmap.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c index 7111d04f2621..8e7208d92de1 100644 --- a/drivers/base/regmap/regmap.c +++ b/drivers/base/regmap/regmap.c @@ -1382,7 +1382,8 @@ int _regmap_raw_write(struct regmap *map, unsigned int reg, */ bool regmap_can_raw_write(struct regmap *map) { - return map->bus && map->format.format_val && map->format.format_reg; + return map->bus && map->bus->write && map->format.format_val && + map->format.format_reg; } EXPORT_SYMBOL_GPL(regmap_can_raw_write); |