X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=drivers%2Fchar%2Fsynclinkmp.c;h=f3e7807f78d98781d903ea8075a970e18c881033;hb=3dd1247f4dee214a92b42e17818703ea71233288;hp=ebde4e55233560eacc7513de2571e3b0213a3c47;hpb=574009c1a895aeeb85eaab29c235d75852b09eb8;p=karo-tx-linux.git diff --git a/drivers/char/synclinkmp.c b/drivers/char/synclinkmp.c index ebde4e552335..f3e7807f78d9 100644 --- a/drivers/char/synclinkmp.c +++ b/drivers/char/synclinkmp.c @@ -66,6 +66,7 @@ #include #include #include +#include #if defined(CONFIG_HDLC) || (defined(CONFIG_HDLC_MODULE) && defined(CONFIG_SYNCLINKMP_MODULE)) #define SYNCLINK_GENERIC_HDLC 1 @@ -80,8 +81,6 @@ #include -#include "linux/synclink.h" - static MGSL_PARAMS default_params = { MGSL_MODE_HDLC, /* unsigned long mode */ 0, /* unsigned char loopback; */ @@ -135,8 +134,6 @@ typedef struct _SCADESC_EX #define IO_PIN_SHUTDOWN_LIMIT 100 -#define RELEVANT_IFLAG(iflag) (iflag & (IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK)) - struct _input_signal_events { int ri_up; int ri_down; @@ -927,12 +924,6 @@ static void set_termios(struct tty_struct *tty, struct ktermios *old_termios) printk("%s(%d):%s set_termios()\n", __FILE__,__LINE__, tty->driver->name ); - /* just return if nothing has changed */ - if ((tty->termios->c_cflag == old_termios->c_cflag) - && (RELEVANT_IFLAG(tty->termios->c_iflag) - == RELEVANT_IFLAG(old_termios->c_iflag))) - return; - change_params(info); /* Handle transition to B0 status */ @@ -2744,8 +2735,7 @@ static int startup(SLMP_INFO * info) change_params(info); - info->status_timer.expires = jiffies + msecs_to_jiffies(10); - add_timer(&info->status_timer); + mod_timer(&info->status_timer, jiffies + msecs_to_jiffies(10)); if (info->tty) clear_bit(TTY_IO_ERROR, &info->tty->flags); @@ -3795,14 +3785,13 @@ static SLMP_INFO *alloc_dev(int adapter_num, int port_num, struct pci_dev *pdev) { SLMP_INFO *info; - info = kmalloc(sizeof(SLMP_INFO), + info = kzalloc(sizeof(SLMP_INFO), GFP_KERNEL); if (!info) { printk("%s(%d) Error can't allocate device instance data for adapter %d, port %d\n", __FILE__,__LINE__, adapter_num, port_num); } else { - memset(info, 0, sizeof(SLMP_INFO)); info->magic = MGSL_MAGIC; INIT_WORK(&info->task, bh_handler); info->max_frame_size = 4096; @@ -3841,13 +3830,9 @@ static SLMP_INFO *alloc_dev(int adapter_num, int port_num, struct pci_dev *pdev) info->bus_type = MGSL_BUS_TYPE_PCI; info->irq_flags = IRQF_SHARED; - init_timer(&info->tx_timer); - info->tx_timer.data = (unsigned long)info; - info->tx_timer.function = tx_timeout; - - init_timer(&info->status_timer); - info->status_timer.data = (unsigned long)info; - info->status_timer.function = status_timeout; + setup_timer(&info->tx_timer, tx_timeout, (unsigned long)info); + setup_timer(&info->status_timer, status_timeout, + (unsigned long)info); /* Store the PCI9050 misc control register value because a flaw * in the PCI9050 prevents LCR registers from being read if @@ -4291,8 +4276,8 @@ void tx_start(SLMP_INFO *info) write_reg(info, TXDMA + DIR, 0x40); /* enable Tx DMA interrupts (EOM) */ write_reg(info, TXDMA + DSR, 0xf2); /* clear Tx DMA IRQs, enable Tx DMA */ - info->tx_timer.expires = jiffies + msecs_to_jiffies(5000); - add_timer(&info->tx_timer); + mod_timer(&info->tx_timer, jiffies + + msecs_to_jiffies(5000)); } else { tx_load_fifo(info); @@ -5574,10 +5559,7 @@ void status_timeout(unsigned long context) if (status) isr_io_pin(info,status); - info->status_timer.data = (unsigned long)info; - info->status_timer.function = status_timeout; - info->status_timer.expires = jiffies + msecs_to_jiffies(10); - add_timer(&info->status_timer); + mod_timer(&info->status_timer, jiffies + msecs_to_jiffies(10)); }