[PATCH] vt_ioctl.c: fix compile error with pm_set_vt_switch()

From: H Hartley Sweeten
Date: Fri Sep 02 2011 - 17:03:21 EST


When CONFIG_PM_SLEEP, CONFIG_VT, and CONFIG_VT_CONSOLE are not enabled
the function pm_set_vt_switch() is defined as an inline in linux/suspend.h. This causes
a compile error if CONFIG_VT is enabled.

drivers/tty/vt/vt_ioctl.c:1794: error: redefinition of 'pm_set_vt_switch'
include/linux/suspend.h:17: error: previous definition of 'pm_set_vt_switch' was here

Fix this with an #if defined guard around the function in vt_ioctl.c.

Signed-off-by: H Hartley Sweeten <hsweeten@xxxxxxxxxxxxxxxxxxx>
Cc: Greg Kroah-Hartman <gregkh@xxxxxxx>
Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
Cc: Arthur Taylor <art@xxxxxxxx>
Cc: Arnd Bergmann <arnd@xxxxxxxx>
Cc: Jiri Slaby <jslaby@xxxxxxx>

---

diff --git a/drivers/tty/vt/vt_ioctl.c b/drivers/tty/vt/vt_ioctl.c
index 5e096f4..7bb1b4d 100644
--- a/drivers/tty/vt/vt_ioctl.c
+++ b/drivers/tty/vt/vt_ioctl.c
@@ -1784,6 +1784,8 @@ int vt_move_to_console(unsigned int vt, int alloc)
return prev;
}

+#if defined(CONFIG_PM_SLEEP) && defined(CONFIG_VT_CONSOLE)
+
/*
* Normally during a suspend, we allocate a new console and switch to it.
* When we resume, we switch back to the original console. This switch
@@ -1798,3 +1800,5 @@ void pm_set_vt_switch(int do_switch)
console_unlock();
}
EXPORT_SYMBOL(pm_set_vt_switch);
+
+#endif
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/