Re: [PATCH 1/2] staging: dgap: removes KERNEL_VERSION conditionals

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'll try this patchset again after Masanari Iida's patches are accepted after
the merge window.

Lidza

On Fri, Jan 17, 2014 at 11:01 AM, Lidza Louina <Lidza.Louina@xxxxxxxxx> wrote:
> 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 <Lidza.Louina@xxxxxxxxx>
> ---
>  drivers/staging/dgap/dgap_driver.h |    4 ----
>  drivers/staging/dgap/dgap_fep5.c   |   36 +-----------------------------------
>  drivers/staging/dgap/dgap_tty.c    |   25 +------------------------
>  3 files changed, 2 insertions(+), 63 deletions(-)
>
> diff --git a/drivers/staging/dgap/dgap_driver.h b/drivers/staging/dgap/dgap_driver.h
> index 2f7a55a7..8c1b46a 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 f75831a..0556f48 100644
> --- a/drivers/staging/dgap/dgap_fep5.c
> +++ b/drivers/staging/dgap/dgap_fep5.c
> @@ -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);
>                                         }
> diff --git a/drivers/staging/dgap/dgap_tty.c b/drivers/staging/dgap/dgap_tty.c
> index 39fb4df..fdf8dc3 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;
> --
> 1.7.9.5
>
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux