Skip to content
Snippets Groups Projects
Commit 2448f607 authored by Mario Six's avatar Mario Six Committed by Simon Glass
Browse files

regmap: Add error output


Add some debug output in cases where the initialization of a regmap
fails.

Reviewed-by: default avatarAnatolij Gustschin <agust@denx.de>
Reviewed-by: default avatarSimon Glass <sjg@chromium.org>
Signed-off-by: default avatarMario Six <mario.six@gdsys.cc>
parent 7f0e3669
No related branches found
No related tags found
No related merge requests found
...@@ -139,12 +139,18 @@ int regmap_init_mem(ofnode node, struct regmap **mapp) ...@@ -139,12 +139,18 @@ int regmap_init_mem(ofnode node, struct regmap **mapp)
} }
len = ofnode_read_size(node, "reg"); len = ofnode_read_size(node, "reg");
if (len < 0) if (len < 0) {
debug("%s: Error while reading reg size (ret = %d)\n",
ofnode_get_name(node), len);
return len; return len;
}
len /= sizeof(fdt32_t); len /= sizeof(fdt32_t);
count = len / both_len; count = len / both_len;
if (!count) if (!count) {
debug("%s: Not enough data in reg property\n",
ofnode_get_name(node));
return -EINVAL; return -EINVAL;
}
map = regmap_alloc(count); map = regmap_alloc(count);
if (!map) if (!map)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment