[PATCH] nios2: add screen_info

From: Sudip Mukherjee
Date: Wed Nov 09 2016 - 18:09:48 EST


The build of nios2 was failing with the error:
drivers/built-in.o: In function `vgacon_switch':
vgacon.c:(.text+0x12174): undefined reference to `screen_info'
vgacon.c:(.text+0x1217c): undefined reference to `screen_info'
drivers/built-in.o: In function `vgacon_resize':
vgacon.c:(.text+0x123f4): undefined reference to `screen_info'
vgacon.c:(.text+0x123f8): undefined reference to `screen_info'
drivers/built-in.o: In function `vgacon_save_screen':
vgacon.c:(.text+0x12528): undefined reference to `screen_info'

Lets define a screen_info which can work as the vga console.

Signed-off-by: Sudip Mukherjee <sudip.mukherjee@xxxxxxxxxxxxxxx>
---

Note: Not tested on hardware. Values of screen_info taken from m32r.

build log is at:
https://travis-ci.org/sudipm-mukherjee/parport/jobs/174408433

arch/nios2/kernel/setup.c | 10 ++++++++++
1 file changed, 10 insertions(+)

diff --git a/arch/nios2/kernel/setup.c b/arch/nios2/kernel/setup.c
index a4ff86d..0c1cd9d4 100644
--- a/arch/nios2/kernel/setup.c
+++ b/arch/nios2/kernel/setup.c
@@ -23,6 +23,7 @@
#include <asm/sections.h>
#include <asm/setup.h>
#include <asm/cpuinfo.h>
+#include <linux/screen_info.h>

unsigned long memory_start;
EXPORT_SYMBOL(memory_start);
@@ -36,6 +37,15 @@
0, 0, 0, 0, 0, 0,
0};

+#if defined(CONFIG_VGA_CONSOLE)
+struct screen_info screen_info = {
+ .orig_video_lines = 25,
+ .orig_video_cols = 80,
+ .orig_video_isVGA = 1,
+ .orig_video_points = 8
+};
+#endif
+
/* Copy a short hook instruction sequence to the exception address */
static inline void copy_exception_handler(unsigned int addr)
{
--
1.9.1