[U-Boot] [PATCH v3 06/13] regmap: Add error output
Mario Six
mario.six at gdsys.cc
Tue Jul 31 10:01:03 UTC 2018
Add some debug output in cases where the initialization of a regmap
fails.
Signed-off-by: Mario Six <mario.six at gdsys.cc>
---
v2 -> v3:
New in v3
---
drivers/core/regmap.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/core/regmap.c b/drivers/core/regmap.c
index 51d9cadc510..3488361ee14 100644
--- a/drivers/core/regmap.c
+++ b/drivers/core/regmap.c
@@ -139,12 +139,18 @@ int regmap_init_mem(ofnode node, struct regmap **mapp)
}
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;
+ }
len /= sizeof(fdt32_t);
count = len / both_len;
- if (!count)
+ if (!count) {
+ debug("%s: Not enough data in reg property\n",
+ ofnode_get_name(node));
return -EINVAL;
+ }
map = regmap_alloc(count);
if (!map)
--
2.11.0
More information about the U-Boot
mailing list