+// SPDX-License-Identifier: GPL-2.0+
/*
* Copyright (c) 2011, Google Inc. All rights reserved.
- *
- * SPDX-License-Identifier: GPL-2.0+
*/
*/
#include <common.h>
-#include <libfdt.h>
+#include <linux/libfdt.h>
#include <malloc.h>
#include <linux/compiler.h>
struct bootstage_data *data = gd->bootstage;
struct bootstage_record *rec;
+ /*
+ * initf_bootstage() is called very early during boot but since hang()
+ * calls bootstage_error() we can be called before bootstage is set up.
+ * Add a check to avoid this.
+ */
+ if (!data)
+ return mark;
if (flags & BOOTSTAGEF_ALLOC)
id = data->next_id++;