[PATCH v3 2/7] ARM: boards: skov-imx6: fixup_machine_compatible() add optional root node
Oleksij Rempel
o.rempel at pengutronix.de
Mon Sep 20 04:15:23 PDT 2021
This will be needed by the next patch
Signed-off-by: Oleksij Rempel <o.rempel at pengutronix.de>
---
arch/arm/boards/skov-imx6/board.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/arch/arm/boards/skov-imx6/board.c b/arch/arm/boards/skov-imx6/board.c
index a58172b2b1..030ac62c52 100644
--- a/arch/arm/boards/skov-imx6/board.c
+++ b/arch/arm/boards/skov-imx6/board.c
@@ -432,16 +432,18 @@ static void skov_init_board(const struct board_description *variant)
}
}
-static void fixup_machine_compatible(const char *compat)
+static void fixup_machine_compatible(const char *compat,
+ struct device_node *root)
{
const char *curcompat;
- struct device_node *root;
int cclen = 0, clen = strlen(compat) + 1;
void *buf;
- root = of_get_root_node();
- if (!root)
- return;
+ if (!root) {
+ root = of_get_root_node();
+ if (!root)
+ return;
+ }
curcompat = of_get_property(root, "compatible", &cclen);
@@ -487,7 +489,7 @@ static int skov_imx6_probe(struct device_d *dev)
globalvar_add_simple("board.dts", variant->dts_compatible);
globalvar_add_simple("board.display", variant->display ?: NULL);
- fixup_machine_compatible(variant->dts_compatible);
+ fixup_machine_compatible(variant->dts_compatible, NULL);
skov_init_board(variant);
--
2.30.2
More information about the barebox
mailing list