diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-08-10 04:14:41 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-08-14 06:51:11 -0400 |
commit | 8de2f081ef8ee716663f916df9f2a7d015fa0dad (patch) | |
tree | 74319c3c14525f063754faab80406416b4a9f1dc /drivers/base/regmap/regmap-debugfs.c | |
parent | 13c54137f7896928ced8e97708d409fa39c09e00 (diff) |
regmap: Add functions to check for access on registers
We're going to be using these in quite a few places so factor out the
readable/writable/volatile/precious checks.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/base/regmap/regmap-debugfs.c')
-rw-r--r-- | drivers/base/regmap/regmap-debugfs.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/base/regmap/regmap-debugfs.c b/drivers/base/regmap/regmap-debugfs.c index 6e304a4e2706..fff8e832a985 100644 --- a/drivers/base/regmap/regmap-debugfs.c +++ b/drivers/base/regmap/regmap-debugfs.c | |||
@@ -52,12 +52,10 @@ static ssize_t regmap_map_read_file(struct file *file, char __user *user_buf, | |||
52 | tot_len = reg_len + val_len + 3; /* : \n */ | 52 | tot_len = reg_len + val_len + 3; /* : \n */ |
53 | 53 | ||
54 | for (i = 0; i < map->max_register; i++) { | 54 | for (i = 0; i < map->max_register; i++) { |
55 | if (map->readable_reg && | 55 | if (!regmap_readable(map, i)) |
56 | !map->readable_reg(map->dev, i)) | ||
57 | continue; | 56 | continue; |
58 | 57 | ||
59 | if (map->precious_reg && | 58 | if (regmap_precious(map, i)) |
60 | map->precious_reg(map->dev, i)) | ||
61 | continue; | 59 | continue; |
62 | 60 | ||
63 | /* If we're in the region the user is trying to read */ | 61 | /* If we're in the region the user is trying to read */ |