打开DEBUG模式后,会使能assert宏,导致部分断言失败后挂起:
#define assert(x) \
({ if (!(x) && _DEBUG) \
__assert_fail(#x, __FILE__, __LINE__, __func__); })
drivers/core/ofnode.c:78: ofnode_read_bool: Assertion `ofnode_valid(node)' failed.
解决方法:
屏蔽该断言语句:
diff --git a/arch/arm/mach-rockchip/hotkey.c b/arch/arm/mach-rockchip/hotkey.c
index 37a03df862..75fdaed487 100644
--- a/arch/arm/mach-rockchip/hotkey.c
+++ b/arch/arm/mach-rockchip/hotkey.c
@@ -76,7 +76,7 @@ void hotkey_run(enum hotkey_t id)
break;
case HK_CLI_OS_GO:
if (gd->console_evt == CTRL_S)
- cli_loop();
+ // cli_loop();
break;
default:
break;
diff --git a/drivers/core/ofnode.c b/drivers/core/ofnode.c
index fe98b2e472..5a7f5a6965 100644
--- a/drivers/core/ofnode.c
+++ b/drivers/core/ofnode.c
@@ -75,7 +75,7 @@ bool ofnode_read_bool(ofnode node, const char *propname)
{
const void *prop;
- assert(ofnode_valid(node));
+// assert(ofnode_valid(node));
debug("%s: %s: ", __func__, propname);
prop = ofnode_get_property(node, propname, NULL);