From: Lidza Louina Date: Fri, 17 Jan 2014 16:01:36 +0000 (-0500) Subject: staging: dgap: removes KERNEL_VERSION conditionals X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=60914a1ad338922e1038a51b613916a7cbc21cb1;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git staging: dgap: removes KERNEL_VERSION conditionals This patch removes the KERNEL_VERSION conditionals. The driver is built for this kernel version, so the conditionals are not needed. Signed-off-by: Lidza Louina Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/dgap/dgap_driver.h b/drivers/staging/dgap/dgap_driver.h index 48d2815520f5..f0f0430f9206 100644 --- a/drivers/staging/dgap/dgap_driver.h +++ b/drivers/staging/dgap/dgap_driver.h @@ -396,10 +396,6 @@ struct board_t u32 dgap_Serial_Major; u32 dgap_TransparentPrint_Major; -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28) - u32 TtyRefCnt; -#endif - struct bs_t *bd_bs; /* Base structure pointer */ char *flipbuf; /* Our flip buffer, alloced if board is found */ diff --git a/drivers/staging/dgap/dgap_fep5.c b/drivers/staging/dgap/dgap_fep5.c index f75831a422e8..0556f48c15de 100644 --- a/drivers/staging/dgap/dgap_fep5.c +++ b/drivers/staging/dgap/dgap_fep5.c @@ -30,10 +30,7 @@ #include #include /* For tty_schedule_flip */ #include - -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39) #include -#endif #include "dgap_driver.h" #include "dgap_pci.h" @@ -1805,19 +1802,11 @@ static int dgap_event(struct board_t *bd) if (ch->ch_tun.un_flags & UN_ISOPEN) { if ((ch->ch_tun.un_tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) && -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,31) ch->ch_tun.un_tty->ldisc->ops->write_wakeup) -#else - ch->ch_tun.un_tty->ldisc.ops->write_wakeup) -#endif { DGAP_UNLOCK(ch->ch_lock, lock_flags2); DGAP_UNLOCK(bd->bd_lock, lock_flags); -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,31) (ch->ch_tun.un_tty->ldisc->ops->write_wakeup)(ch->ch_tun.un_tty); -#else - (ch->ch_tun.un_tty->ldisc.ops->write_wakeup)(ch->ch_tun.un_tty); -#endif DGAP_LOCK(bd->bd_lock, lock_flags); DGAP_LOCK(ch->ch_lock, lock_flags2); } @@ -1833,19 +1822,11 @@ static int dgap_event(struct board_t *bd) if (ch->ch_pun.un_flags & UN_ISOPEN) { if ((ch->ch_pun.un_tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) && -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,31) ch->ch_pun.un_tty->ldisc->ops->write_wakeup) -#else - ch->ch_pun.un_tty->ldisc.ops->write_wakeup) -#endif { DGAP_UNLOCK(ch->ch_lock, lock_flags2); DGAP_UNLOCK(bd->bd_lock, lock_flags); -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,31) (ch->ch_pun.un_tty->ldisc->ops->write_wakeup)(ch->ch_pun.un_tty); -#else - (ch->ch_pun.un_tty->ldisc.ops->write_wakeup)(ch->ch_pun.un_tty); -#endif DGAP_LOCK(bd->bd_lock, lock_flags); DGAP_LOCK(ch->ch_lock, lock_flags2); } @@ -1871,19 +1852,12 @@ static int dgap_event(struct board_t *bd) if (ch->ch_tun.un_flags & UN_ISOPEN) { if ((ch->ch_tun.un_tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) && -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,31) ch->ch_tun.un_tty->ldisc->ops->write_wakeup) -#else - ch->ch_tun.un_tty->ldisc.ops->write_wakeup) -#endif { DGAP_UNLOCK(ch->ch_lock, lock_flags2); DGAP_UNLOCK(bd->bd_lock, lock_flags); -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,31) + (ch->ch_tun.un_tty->ldisc->ops->write_wakeup)(ch->ch_tun.un_tty); -#else - (ch->ch_tun.un_tty->ldisc.ops->write_wakeup)(ch->ch_tun.un_tty); -#endif DGAP_LOCK(bd->bd_lock, lock_flags); DGAP_LOCK(ch->ch_lock, lock_flags2); } @@ -1897,19 +1871,11 @@ static int dgap_event(struct board_t *bd) if (ch->ch_pun.un_flags & UN_ISOPEN) { if ((ch->ch_pun.un_tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) && -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,31) ch->ch_pun.un_tty->ldisc->ops->write_wakeup) -#else - ch->ch_pun.un_tty->ldisc.ops->write_wakeup) -#endif { DGAP_UNLOCK(ch->ch_lock, lock_flags2); DGAP_UNLOCK(bd->bd_lock, lock_flags); -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,31) (ch->ch_pun.un_tty->ldisc->ops->write_wakeup)(ch->ch_pun.un_tty); -#else - (ch->ch_pun.un_tty->ldisc.ops->write_wakeup)(ch->ch_pun.un_tty); -#endif DGAP_LOCK(bd->bd_lock, lock_flags); DGAP_LOCK(ch->ch_lock, lock_flags2); } diff --git a/drivers/staging/dgap/dgap_tty.c b/drivers/staging/dgap/dgap_tty.c index 39fb4dfb8b7e..fdf8dc357ce0 100644 --- a/drivers/staging/dgap/dgap_tty.c +++ b/drivers/staging/dgap/dgap_tty.c @@ -61,11 +61,9 @@ #include "dgap_conf.h" #include "dgap_sysfs.h" -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37) #define init_MUTEX(sem) sema_init(sem, 1) #define DECLARE_MUTEX(name) \ struct semaphore name = __SEMAPHORE_INITIALIZER(name, 1) -#endif /* * internal variables @@ -131,13 +129,8 @@ static int dgap_set_modem_info(struct tty_struct *tty, unsigned int command, uns static int dgap_get_modem_info(struct channel_t *ch, unsigned int __user *value); static int dgap_tty_digisetcustombaud(struct tty_struct *tty, int __user *new_info); static int dgap_tty_digigetcustombaud(struct tty_struct *tty, int __user *retinfo); -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39) static int dgap_tty_tiocmget(struct tty_struct *tty); static int dgap_tty_tiocmset(struct tty_struct *tty, unsigned int set, unsigned int clear); -#else -static int dgap_tty_tiocmget(struct tty_struct *tty, struct file *file); -static int dgap_tty_tiocmset(struct tty_struct *tty, struct file *file, unsigned int set, unsigned int clear); -#endif static int dgap_tty_send_break(struct tty_struct *tty, int msec); static void dgap_tty_wait_until_sent(struct tty_struct *tty, int timeout); static int dgap_tty_write(struct tty_struct *tty, const unsigned char *buf, int count); @@ -237,10 +230,6 @@ int dgap_tty_register(struct board_t *brd) if (!brd->SerialDriver->ttys) return(-ENOMEM); -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28) - brd->SerialDriver->refcount = brd->TtyRefCnt; -#endif - /* * Entry points for driver. Called by the kernel from * tty_io.c and n_tty.c. @@ -270,10 +259,6 @@ int dgap_tty_register(struct board_t *brd) if (!brd->PrintDriver->ttys) return(-ENOMEM); -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28) - brd->PrintDriver->refcount = brd->TtyRefCnt; -#endif - /* * Entry points for driver. Called by the kernel from * tty_io.c and n_tty.c. @@ -2109,11 +2094,7 @@ static int dgap_tty_write(struct tty_struct *tty, const unsigned char *buf, int /* * Return modem signals to ld. */ -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39) static int dgap_tty_tiocmget(struct tty_struct *tty) -#else -static int dgap_tty_tiocmget(struct tty_struct *tty, struct file *file) -#endif { struct channel_t *ch; struct un_t *un; @@ -2168,13 +2149,9 @@ static int dgap_tty_tiocmget(struct tty_struct *tty, struct file *file) * * Set modem signals, called by ld. */ -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39) + static int dgap_tty_tiocmset(struct tty_struct *tty, unsigned int set, unsigned int clear) -#else -static int dgap_tty_tiocmset(struct tty_struct *tty, struct file *file, - unsigned int set, unsigned int clear) -#endif { struct board_t *bd; struct channel_t *ch;