diff --git a/include/asm-mips/setup.h b/include/asm-mips/setup.h
index 883f59bfa097..e600cedda976 100644
--- a/include/asm-mips/setup.h
+++ b/include/asm-mips/setup.h
@@ -3,6 +3,8 @@
 
 #define COMMAND_LINE_SIZE	256
 
+#ifdef  __KERNEL__
 extern void setup_early_printk(void);
+#endif /* __KERNEL__ */
 
 #endif /* __SETUP_H */