mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-18 21:21:37 +00:00
regmap: Add error output
Add some debug output in cases where the initialization of a regmap fails. Reviewed-by: Anatolij Gustschin <agust@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Mario Six <mario.six@gdsys.cc>
This commit is contained in:
parent
7f0e366999
commit
2448f607dc
1 changed files with 8 additions and 2 deletions
|
@ -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)
|
||||||
|
|
Loading…
Add table
Reference in a new issue