summaryrefslogtreecommitdiff
path: root/drivers/base
diff options
context:
space:
mode:
authorMarkus Pargmann <mpa@pengutronix.de>2015-08-12 13:12:33 +0300
committerMark Brown <broonie@kernel.org>2015-08-14 21:07:39 +0300
commit07ea400e1b26726f21b2c2299d187d6eb7eb4324 (patch)
tree35313c14111c2f8d7bb710684646803c6547b07c /drivers/base
parentbc0195aad0daa2ad5b0d76cce22b167bc3435590 (diff)
downloadlinux-07ea400e1b26726f21b2c2299d187d6eb7eb4324.tar.xz
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')
-rw-r--r--drivers/base/regmap/regmap.c3
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);