Commit f7d01359 authored by Lucas Tanure's avatar Lucas Tanure Committed by Mark Brown

regmap: Fix order of regmap write log

_regmap_write can trigger a _regmap_select_page, which will call
another _regmap_write that will be executed first, but the log shows
the inverse order

Also, keep consistency with _regmap_read which only logs in case of
success
Signed-off-by: default avatarLucas Tanure <tanureal@opensource.cirrus.com>
Reviewed-by: default avatarCharles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20201112150217.459844-1-tanureal@opensource.cirrus.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 6e1e90ec
......@@ -1924,12 +1924,15 @@ int _regmap_write(struct regmap *map, unsigned int reg,
}
}
if (regmap_should_log(map))
dev_info(map->dev, "%x <= %x\n", reg, val);
ret = map->reg_write(context, reg, val);
if (ret == 0) {
if (regmap_should_log(map))
dev_info(map->dev, "%x <= %x\n", reg, val);
trace_regmap_reg_write(map, reg, val);
trace_regmap_reg_write(map, reg, val);
}
return map->reg_write(context, reg, val);
return ret;
}
/**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment