diff mbox series

[2/3] MIPS: Fix CONFIG_OF_EARLY_FLATTREE=n builds

Message ID 20191012204326.2564623-2-paul.burton@mips.com (mailing list archive)
State Mainlined
Commit 972727766ee4d9e8b455c09e8dcb1e7dc14c4967
Delegated to: Paul Burton
Headers show
Series [1/3] MIPS: Always define builtin_cmdline | expand

Commit Message

Paul Burton Oct. 12, 2019, 8:43 p.m. UTC
Configurations with CONFIG_OF_EARLY_FLATTREE=n fail to build since
commit 7784cac69735 ("MIPS: cmdline: Clean up boot_command_line
initialization") because of_scan_flat_dt() & of_scan_flat_dt() are not
defined in these configurations. Fix this by #ifdef'ing the affected
code...

Signed-off-by: Paul Burton <paul.burton@mips.com>
Fixes: 7784cac69735 ("MIPS: cmdline: Clean up boot_command_line initialization")
Reported-by: kbuild test robot <lkp@intel.com>
---

 arch/mips/kernel/setup.c | 6 ++++++
 1 file changed, 6 insertions(+)
diff mbox series

Patch

diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
index 119999d31558..7ccc8a9e1bfe 100644
--- a/arch/mips/kernel/setup.c
+++ b/arch/mips/kernel/setup.c
@@ -551,6 +551,8 @@  static void __init bootcmdline_append(const char *s, size_t max)
 	strlcat(boot_command_line, s, max);
 }
 
+#ifdef CONFIG_OF_EARLY_FLATTREE
+
 static int __init bootcmdline_scan_chosen(unsigned long node, const char *uname,
 					  int depth, void *data)
 {
@@ -571,6 +573,8 @@  static int __init bootcmdline_scan_chosen(unsigned long node, const char *uname,
 	return 1;
 }
 
+#endif /* CONFIG_OF_EARLY_FLATTREE */
+
 static void __init bootcmdline_init(char **cmdline_p)
 {
 	bool dt_bootargs = false;
@@ -597,12 +601,14 @@  static void __init bootcmdline_init(char **cmdline_p)
 	else
 		boot_command_line[0] = 0;
 
+#ifdef CONFIG_OF_EARLY_FLATTREE
 	/*
 	 * If we're configured to take boot arguments from DT, look for those
 	 * now.
 	 */
 	if (IS_ENABLED(CONFIG_MIPS_CMDLINE_FROM_DTB))
 		of_scan_flat_dt(bootcmdline_scan_chosen, &dt_bootargs);
+#endif
 
 	/*
 	 * If we didn't get any arguments from DT (regardless of whether that's