From 61ab4d721f0349105f612e633a7fa2a59ceb52ea Mon Sep 17 00:00:00 2001 From: David Wu Date: Wed, 27 Nov 2019 10:22:07 +0800 Subject: [PATCH] power: io-domain: Don't printf sudev->name when get regulator failed This patch fixed the following issue: Stack: [< 00295020 >] strnlen+0x10/0x28 [< 002965b4 >] vsnprintf_internal+0x61c/0xa84 [< 00296a6c >] vscnprintf+0x50/0x74 [< 00296c58 >] printf+0x94/0xb4 [< 00263e04 >] rockchip_iodomain_probe+0xcc/0x19c [< 0022e310 >] device_probe+0x21c/0x268 [< 0022f3e8 >] uclass_get_device_tail+0x1c/0x40 [< 0022f6dc >] uclass_first_device+0x30/0x44 [< 00263cdc >] io_domain_init+0x2c/0x50 [< 00202da8 >] board_init+0xb4/0xc4 [< 0027a480 >] initcall_run_list+0x58/0x94 [< 00214fbc >] board_init_r+0x20/0x24 [< 00201b24 >] relocation_return+0x4/0x0 Change-Id: I1afc2613a1dba32e7f9c6ad2165e80853d421187 Signed-off-by: David Wu --- drivers/power/io-domain/rockchip-io-domain.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/power/io-domain/rockchip-io-domain.c b/drivers/power/io-domain/rockchip-io-domain.c index ced9fd4f49..6f680dbdc0 100644 --- a/drivers/power/io-domain/rockchip-io-domain.c +++ b/drivers/power/io-domain/rockchip-io-domain.c @@ -485,9 +485,9 @@ static struct udevice *of_get_regulator(ofnode node, const char *supply) snode = ofnode_get_by_phandle(phandle); ret = regulator_get_by_devname(snode.np->name, &sudev); if (ret) { - printf("%s: %s: Get supply(%s) failed, ret=%d", + printf("%s: Get (%s) regulator: %s failed, ret=%d\n", __func__, - sudev->name, snode.np->full_name, ret); + sname, snode.np->full_name, ret); return NULL; } debug("IO-DOMAIN: supply: %s\n", snode.np->full_name);