aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario Six2018-10-15 02:24:08 -0500
committerSimon Glass2018-11-14 11:16:27 -0600
commit2448f607dc904a385148ea506df6bd037f8a248b (patch)
treeb615a34fbeb4dae5c7de5a489525fc1fab100f3b /drivers
parent7f0e36699952adee90dc29b5a9db1378f3a7ae06 (diff)
downloadu-boot-2448f607dc904a385148ea506df6bd037f8a248b.tar.gz
u-boot-2448f607dc904a385148ea506df6bd037f8a248b.tar.xz
u-boot-2448f607dc904a385148ea506df6bd037f8a248b.zip
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/core/regmap.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/core/regmap.c b/drivers/core/regmap.c
index 25c1ae5d7d..154426269d 100644
--- a/drivers/core/regmap.c
+++ b/drivers/core/regmap.c
@@ -139,12 +139,18 @@ int regmap_init_mem(ofnode node, struct regmap **mapp)
139 } 139 }
140 140
141 len = ofnode_read_size(node, "reg"); 141 len = ofnode_read_size(node, "reg");
142 if (len < 0) 142 if (len < 0) {
143 debug("%s: Error while reading reg size (ret = %d)\n",
144 ofnode_get_name(node), len);
143 return len; 145 return len;
146 }
144 len /= sizeof(fdt32_t); 147 len /= sizeof(fdt32_t);
145 count = len / both_len; 148 count = len / both_len;
146 if (!count) 149 if (!count) {
150 debug("%s: Not enough data in reg property\n",
151 ofnode_get_name(node));
147 return -EINVAL; 152 return -EINVAL;
153 }
148 154
149 map = regmap_alloc(count); 155 map = regmap_alloc(count);
150 if (!map) 156 if (!map)