[RFC 2/2] regmap: make use of cached entries in debugfs

From: Wolfram Sang
Date: Mon Jan 30 2012 - 09:08:28 EST


Currently, registers not marked as readable won't be displayed via
debugfs. So, a chip with write-only registers shows nothing because of
no readable registers, although regcache knows the current values. Fix
debugfs to only require the readable-flag when no cache is active,
otherwise try reading the cache.

Signed-off-by: Wolfram Sang <w.sang@xxxxxxxxxxxxxx>
---
drivers/base/regmap/regmap-debugfs.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/base/regmap/regmap-debugfs.c b/drivers/base/regmap/regmap-debugfs.c
index 6f39747..c5a57f3 100644
--- a/drivers/base/regmap/regmap-debugfs.c
+++ b/drivers/base/regmap/regmap-debugfs.c
@@ -58,7 +58,7 @@ static ssize_t regmap_map_read_file(struct file *file, char __user *user_buf,
tot_len = reg_len + val_len + 3; /* : \n */

for (i = 0; i < map->max_register + 1; i++) {
- if (!regmap_readable(map, i))
+ if (map->cache_type == REGCACHE_NONE && !regmap_readable(map, i))
continue;

if (regmap_precious(map, i))
--
1.7.8.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/