diff options
-rw-r--r-- | drivers/base/regmap/regmap-debugfs.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/base/regmap/regmap-debugfs.c b/drivers/base/regmap/regmap-debugfs.c index 9099cd33fbcb..720e14248167 100644 --- a/drivers/base/regmap/regmap-debugfs.c +++ b/drivers/base/regmap/regmap-debugfs.c | |||
@@ -116,6 +116,16 @@ static unsigned int regmap_debugfs_get_dump_start(struct regmap *map, | |||
116 | } | 116 | } |
117 | } | 117 | } |
118 | 118 | ||
119 | /* | ||
120 | * This should never happen; we return above if we fail to | ||
121 | * allocate and we should never be in this code if there are | ||
122 | * no registers at all. | ||
123 | */ | ||
124 | if (list_empty(&map->debugfs_off_cache)) { | ||
125 | WARN_ON(list_empty(&map->debugfs_off_cache)); | ||
126 | return base; | ||
127 | } | ||
128 | |||
119 | /* Find the relevant block */ | 129 | /* Find the relevant block */ |
120 | list_for_each_entry(c, &map->debugfs_off_cache, list) { | 130 | list_for_each_entry(c, &map->debugfs_off_cache, list) { |
121 | if (from >= c->min && from <= c->max) { | 131 | if (from >= c->min && from <= c->max) { |