diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-11-30 18:27:08 +0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-12-01 00:51:09 +0400 |
commit | bc7ee55633867909bb05e71f957a4d3c1aa1b488 (patch) | |
tree | b8465a2ee229fed3a7ea133a983236ffe7f657d7 /drivers/base | |
parent | 018690d33ecf4aa1eb1415e38c40e2b0b6c7808e (diff) | |
download | linux-bc7ee55633867909bb05e71f957a4d3c1aa1b488.tar.xz |
regmap: Add trace event for successful cache reads
Currently we only trace physical reads, there's no instrumentation if
the read is satisfied from cache.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/base')
-rw-r--r-- | drivers/base/regmap/regcache.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/base/regmap/regcache.c b/drivers/base/regmap/regcache.c index 1ca2d7a1051f..1ead66186b7c 100644 --- a/drivers/base/regmap/regcache.c +++ b/drivers/base/regmap/regcache.c @@ -193,13 +193,21 @@ void regcache_exit(struct regmap *map) int regcache_read(struct regmap *map, unsigned int reg, unsigned int *value) { + int ret; + if (map->cache_type == REGCACHE_NONE) return -ENOSYS; BUG_ON(!map->cache_ops); - if (!regmap_volatile(map, reg)) - return map->cache_ops->read(map, reg, value); + if (!regmap_volatile(map, reg)) { + ret = map->cache_ops->read(map, reg, value); + + if (ret == 0) + trace_regmap_reg_read_cache(map->dev, reg, *value); + + return ret; + } return -EINVAL; } |