summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5a1d6d1)
raw | patch | inline | side by side (parent: 5a1d6d1)
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | |
Tue, 8 Jan 2013 13:35:58 +0000 (13:35 +0000) | ||
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | |
Tue, 8 Jan 2013 20:52:46 +0000 (20:52 +0000) |
Rather than trying to soldier on with a partially allocated cache just
throw the cache away and pretend we don't have one in case we can get a
full cache next time around.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
throw the cache away and pretend we don't have one in case we can get a
full cache next time around.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
drivers/base/regmap/regmap-debugfs.c | patch | blob | history |
index e8d15db2f126baed00c3b2cdc94316d76122e92f..9099cd33fbcb87f1364575e2ade64bf307e34ccc 100644 (file)
.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.
/* 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;
}
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);
}