mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-07 07:08:07 +00:00
regmap: debugfs: Ensure a correct return value for empty caches
This should never happen in the real world. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This commit is contained in:
parent
95f971c745
commit
5bd9f4bb34
1 changed files with 10 additions and 0 deletions
|
@ -116,6 +116,16 @@ static unsigned int regmap_debugfs_get_dump_start(struct regmap *map,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This should never happen; we return above if we fail to
|
||||||
|
* allocate and we should never be in this code if there are
|
||||||
|
* no registers at all.
|
||||||
|
*/
|
||||||
|
if (list_empty(&map->debugfs_off_cache)) {
|
||||||
|
WARN_ON(list_empty(&map->debugfs_off_cache));
|
||||||
|
return base;
|
||||||
|
}
|
||||||
|
|
||||||
/* Find the relevant block */
|
/* Find the relevant block */
|
||||||
list_for_each_entry(c, &map->debugfs_off_cache, list) {
|
list_for_each_entry(c, &map->debugfs_off_cache, list) {
|
||||||
if (from >= c->min && from <= c->max) {
|
if (from >= c->min && from <= c->max) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue