Re: [PATCH v3] regmap: debugfs: Add a registers `range' file

From: Mark Brown
Date: Fri Feb 08 2013 - 06:47:00 EST


On Fri, Feb 01, 2013 at 12:05:39PM +0000, Dimitris Papastamos wrote:

> +struct regmap_reg_range {
> + unsigned int start;
> + unsigned int end;
> + unsigned int attr;
> +};

> + i = start_reg;
> + while (i <= map->max_register) {
> + reg_attr = regmap_attr_bitmap(map, i);
> + switch (state) {

We're doing a linear scan through the entire register map here in order
to build up a list of which registers exist, doing it every time the
file is read. This data structure looks *very* like the one we have for
the reads themselves, it seems like we should be sharing the work here
and using the same cache.

Attachment: signature.asc
Description: Digital signature