Commit 60914a1a authored by Lidza Louina's avatar Lidza Louina Committed by Greg Kroah-Hartman

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: default avatarLidza Louina <Lidza.Louina@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f513cb47
......@@ -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 */
......
......@@ -30,10 +30,7 @@
#include <linux/tty.h>
#include <linux/tty_flip.h> /* For tty_schedule_flip */
#include <linux/slab.h>
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)
#include <linux/sched.h>
#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);
}
......
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment