From: Mario Six Date: Thu, 4 Oct 2018 09:00:45 +0200 Subject: [U-Boot] [PATCH v10 06/16] regmap: Add error output In-Reply-To: <20181004070055.1669-1-mario.six@gdsys.cc> References: <20181004070055.1669-1-mario.six@gdsys.cc> Message-ID: <20181004070055.1669-6-mario.six@gdsys.cc> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Add some debug output in cases where the initialization of a regmap fails. Reviewed-by: Anatolij Gustschin Reviewed-by: Simon Glass Signed-off-by: Mario Six --- v9 -> v10: No changes v8 -> v9: No changes v7 -> v8: No changes v6 -> v7: No changes v5 -> v6: No changes v4 -> v5: No changes v3 -> v4: No changes 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 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) } 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