diff options
| author | Mario Six <[email protected]> | 2018-10-15 09:24:08 +0200 |
|---|---|---|
| committer | Simon Glass <[email protected]> | 2018-11-14 09:16:27 -0800 |
| commit | 2448f607dc904a385148ea506df6bd037f8a248b (patch) | |
| tree | b615a34fbeb4dae5c7de5a489525fc1fab100f3b /drivers | |
| parent | 7f0e36699952adee90dc29b5a9db1378f3a7ae06 (diff) | |
regmap: Add error output
Add some debug output in cases where the initialization of a regmap
fails.
Reviewed-by: Anatolij Gustschin <[email protected]>
Reviewed-by: Simon Glass <[email protected]>
Signed-off-by: Mario Six <[email protected]>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/core/regmap.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/core/regmap.c b/drivers/core/regmap.c index 25c1ae5d7df..154426269d9 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) |
