Skip to contentSkip to conversation

of: unittest: Fix test build on config without CONFIG_OF_ADDRESS

PATCH In review Herve Codina 2 participants 2 messages Oct 27, 2023 Device tree

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 of: unittest: Fix test build on config without CONFIG_OF_ADDRESS

of_address_to_resource() is not defined if !CONFIG_OF_ADDRESS.

Return early in of_unittest_check_addr() to avoid the of_address_to_resource() usage.

---
Rob,

This fixes a patch you already applied from my series
https://lore.kernel.org/all/[email protected]/

I don't know if it's too late or not but maybe you can squash this fix patch.

My apologies for this issue.

Hervé

 drivers/of/unittest.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/of/unittest.c +3 -0
index ffbecd349899..e9e90e96600e 100644
@@ -1201,6 +1201,9 @@ static void __init of_unittest_check_addr(const char *node_path,
 	unsigned int count;
 	int ret;
 
+	if (!IS_ENABLED(CONFIG_OF_ADDRESS))
+		return;
+
 	np = of_find_node_by_path(node_path);
 	if (!np) {
 		pr_err("missing testcase data (%s)\n", node_path);
Signature · 1 line
2.41.0
maintainer
#1 lore raw
Quoted 14 lines · Herve Codina

of_address_to_resource() is not defined if !CONFIG_OF_ADDRESS.

Return early in of_unittest_check_addr() to avoid the of_address_to_resource() usage.

---
Rob,

This fixes a patch you already applied from my series
https://lore.kernel.org/all/[email protected]/

Quoted 9 lines

I don't know if it's too late or not but maybe you can squash this fix patch.

My apologies for this issue.

Hervé

 drivers/of/unittest.c | 3 +++
 1 file changed, 3 insertions(+)

Squashed and applied, thanks!