regmap-debugfs.c (c0cc6fe1d09e3f1baecbdf8922473c8e7d3a5317) regmap-debugfs.c (f01ee60fffa4dc6c77122121233a793f7f696e67)
1/*
2 * Register map access API - debugfs
3 *
4 * Copyright 2011 Wolfson Microelectronics plc
5 *
6 * Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
7 *
8 * This program is free software; you can redistribute it and/or modify

--- 66 unchanged lines hidden (view full) ---

75 if (!buf)
76 return -ENOMEM;
77
78 /* Calculate the length of a fixed format */
79 reg_len = regmap_calc_reg_len(map->max_register, buf, count);
80 val_len = 2 * map->format.val_bytes;
81 tot_len = reg_len + val_len + 3; /* : \n */
82
1/*
2 * Register map access API - debugfs
3 *
4 * Copyright 2011 Wolfson Microelectronics plc
5 *
6 * Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
7 *
8 * This program is free software; you can redistribute it and/or modify

--- 66 unchanged lines hidden (view full) ---

75 if (!buf)
76 return -ENOMEM;
77
78 /* Calculate the length of a fixed format */
79 reg_len = regmap_calc_reg_len(map->max_register, buf, count);
80 val_len = 2 * map->format.val_bytes;
81 tot_len = reg_len + val_len + 3; /* : \n */
82
83 for (i = 0; i < map->max_register + 1; i++) {
83 for (i = 0; i <= map->max_register; i += map->reg_stride) {
84 if (!regmap_readable(map, i))
85 continue;
86
87 if (regmap_precious(map, i))
88 continue;
89
90 /* If we're in the region the user is trying to read */
91 if (p >= *ppos) {

--- 100 unchanged lines hidden (view full) ---

192 buf = kmalloc(count, GFP_KERNEL);
193 if (!buf)
194 return -ENOMEM;
195
196 /* Calculate the length of a fixed format */
197 reg_len = regmap_calc_reg_len(map->max_register, buf, count);
198 tot_len = reg_len + 10; /* ': R W V P\n' */
199
84 if (!regmap_readable(map, i))
85 continue;
86
87 if (regmap_precious(map, i))
88 continue;
89
90 /* If we're in the region the user is trying to read */
91 if (p >= *ppos) {

--- 100 unchanged lines hidden (view full) ---

192 buf = kmalloc(count, GFP_KERNEL);
193 if (!buf)
194 return -ENOMEM;
195
196 /* Calculate the length of a fixed format */
197 reg_len = regmap_calc_reg_len(map->max_register, buf, count);
198 tot_len = reg_len + 10; /* ': R W V P\n' */
199
200 for (i = 0; i < map->max_register + 1; i++) {
200 for (i = 0; i <= map->max_register; i += map->reg_stride) {
201 /* Ignore registers which are neither readable nor writable */
202 if (!regmap_readable(map, i) && !regmap_writeable(map, i))
203 continue;
204
205 /* If we're in the region the user is trying to read */
206 if (p >= *ppos) {
207 /* ...but not beyond it */
208 if (buf_pos >= count - 1 - tot_len)

--- 86 unchanged lines hidden ---
201 /* Ignore registers which are neither readable nor writable */
202 if (!regmap_readable(map, i) && !regmap_writeable(map, i))
203 continue;
204
205 /* If we're in the region the user is trying to read */
206 if (p >= *ppos) {
207 /* ...but not beyond it */
208 if (buf_pos >= count - 1 - tot_len)

--- 86 unchanged lines hidden ---