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>
This commit is contained in:
Markus Pargmann 2015-08-12 12:12:33 +02:00 committed by Mark Brown
parent bc0195aad0
commit 07ea400e1b

View File

@ -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);