Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 348803
b: refs/heads/master
c: 95f971c
h: refs/heads/master
i:
  348801: e9c7ab2
  348799: 4b0bd8c
v: v3
  • Loading branch information
Mark Brown committed Jan 8, 2013
1 parent b64b494 commit 9d8d9cc
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5a1d6d172bc8a3ecf29add6c84d047025cb71566
refs/heads/master: 95f971c745a343255744703dc4ae8d78508519cc
29 changes: 18 additions & 11 deletions trunk/drivers/base/regmap/regmap-debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,19 @@ static const struct file_operations regmap_name_fops = {
.llseek = default_llseek,
};

static void regmap_debugfs_free_dump_cache(struct regmap *map)
{
struct regmap_debugfs_off_cache *c;

while (!list_empty(&map->debugfs_off_cache)) {
c = list_first_entry(&map->debugfs_off_cache,
struct regmap_debugfs_off_cache,
list);
list_del(&c->list);
kfree(c);
}
}

/*
* Work out where the start offset maps into register numbers, bearing
* in mind that we suppress hidden registers.
Expand Down Expand Up @@ -91,8 +104,10 @@ static unsigned int regmap_debugfs_get_dump_start(struct regmap *map,
/* No cache entry? Start a new one */
if (!c) {
c = kzalloc(sizeof(*c), GFP_KERNEL);
if (!c)
break;
if (!c) {
regmap_debugfs_free_dump_cache(map);
return base;
}
c->min = p;
c->base_reg = i;
}
Expand Down Expand Up @@ -388,16 +403,8 @@ void regmap_debugfs_init(struct regmap *map, const char *name)

void regmap_debugfs_exit(struct regmap *map)
{
struct regmap_debugfs_off_cache *c;

debugfs_remove_recursive(map->debugfs);
while (!list_empty(&map->debugfs_off_cache)) {
c = list_first_entry(&map->debugfs_off_cache,
struct regmap_debugfs_off_cache,
list);
list_del(&c->list);
kfree(c);
}
regmap_debugfs_free_dump_cache(map);
kfree(map->debugfs_name);
}

Expand Down

0 comments on commit 9d8d9cc

Please sign in to comment.