From 2cdcb05222926e10806a44d2ab923c4a2090f979 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Wed, 6 Nov 2013 17:53:50 +0100 Subject: [PATCH] backports: do not build tty backport if it is not in the kernel The backported parts of tty are depending on tty being build into the kernel, deactivate them if tty was not activated in the kernel config. Signed-off-by: Hauke Mehrtens --- backport/compat/backport-3.10.c | 2 ++ backport/compat/compat-2.6.28.c | 2 ++ backport/compat/compat-2.6.39.c | 2 ++ 3 files changed, 6 insertions(+) diff --git a/backport/compat/backport-3.10.c b/backport/compat/backport-3.10.c index f44525029e55..07a8dacc19e3 100644 --- a/backport/compat/backport-3.10.c +++ b/backport/compat/backport-3.10.c @@ -95,6 +95,7 @@ unsigned int get_random_int(void) EXPORT_SYMBOL_GPL(get_random_int); #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,28)) +#ifdef CONFIG_TTY /** * tty_port_tty_wakeup - helper to wake up a tty * @@ -126,4 +127,5 @@ void tty_port_tty_hangup(struct tty_port *port, bool check_clocal) tty_kref_put(tty); } EXPORT_SYMBOL_GPL(tty_port_tty_hangup); +#endif /* CONFIG_TTY */ #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,28)) */ diff --git a/backport/compat/compat-2.6.28.c b/backport/compat/compat-2.6.28.c index e38004f1776e..1a4b01daf1a3 100644 --- a/backport/compat/compat-2.6.28.c +++ b/backport/compat/compat-2.6.28.c @@ -318,6 +318,7 @@ void v2_6_28_skb_add_rx_frag(struct sk_buff *skb, int i, struct page *page, int } EXPORT_SYMBOL_GPL(v2_6_28_skb_add_rx_frag); +#ifdef CONFIG_TTY void tty_write_unlock(struct tty_struct *tty) { mutex_unlock(&tty->atomic_write_lock); @@ -443,6 +444,7 @@ int n_tty_ioctl_helper(struct tty_struct *tty, struct file *file, } } EXPORT_SYMBOL_GPL(n_tty_ioctl_helper); +#endif /* CONFIG_TTY */ #ifdef CONFIG_PCI /** diff --git a/backport/compat/compat-2.6.39.c b/backport/compat/compat-2.6.39.c index 62d8a6666b2c..44796da104dc 100644 --- a/backport/compat/compat-2.6.39.c +++ b/backport/compat/compat-2.6.39.c @@ -14,6 +14,7 @@ #include #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)) +#ifdef CONFIG_TTY /* * Termios Helper Methods */ @@ -111,5 +112,6 @@ int tty_set_termios(struct tty_struct *tty, struct ktermios *new_termios) return 0; } EXPORT_SYMBOL_GPL(tty_set_termios); +#endif /* CONFIG_TTY */ #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)) */ -- 2.30.2