{
struct channel_t *ch;
struct un_t *un;
- int rc = -EIO;
+ int rc;
unsigned char mstat = 0;
unsigned long flags;
if (!tty || tty->magic != TTY_MAGIC)
- return rc;
+ return -EIO;
un = tty->driver_data;
if (!un || un->magic != DGNC_UNIT_MAGIC)
- return rc;
+ return -EIO;
ch = un->un_ch;
if (!ch || ch->magic != DGNC_CHANNEL_MAGIC)
- return rc;
+ return -EIO;
spin_lock_irqsave(&ch->ch_lock, flags);
struct dgnc_board *bd;
struct channel_t *ch;
struct un_t *un;
- int rc = -EIO;
unsigned long flags;
if (!tty || tty->magic != TTY_MAGIC)
- return rc;
+ return -EIO;
un = tty->driver_data;
if (!un || un->magic != DGNC_UNIT_MAGIC)
- return rc;
+ return -EIO;
ch = un->un_ch;
if (!ch || ch->magic != DGNC_CHANNEL_MAGIC)
- return rc;
+ return -EIO;
bd = ch->ch_bd;
if (!bd || bd->magic != DGNC_BOARD_MAGIC)
- return rc;
+ return -EIO;
spin_lock_irqsave(&ch->ch_lock, flags);
struct dgnc_board *bd;
struct channel_t *ch;
struct un_t *un;
- int rc = -EIO;
unsigned long flags;
if (!tty || tty->magic != TTY_MAGIC)
- return rc;
+ return -EIO;
un = tty->driver_data;
if (!un || un->magic != DGNC_UNIT_MAGIC)
- return rc;
+ return -EIO;
ch = un->un_ch;
if (!ch || ch->magic != DGNC_CHANNEL_MAGIC)
- return rc;
+ return -EIO;
bd = ch->ch_bd;
if (!bd || bd->magic != DGNC_BOARD_MAGIC)
- return rc;
+ return -EIO;
switch (msec) {
case -1:
static inline int dgnc_get_mstat(struct channel_t *ch)
{
unsigned char mstat;
- int rc = -ENXIO;
unsigned long flags;
+ int rc;
if (!ch || ch->magic != DGNC_CHANNEL_MAGIC)
- return rc;
+ return -ENXIO;
spin_lock_irqsave(&ch->ch_lock, flags);
struct un_t *un;
struct digi_t tmp;
unsigned long flags;
- int rc = -EFAULT;
if (!retinfo)
- return rc;
+ return -EFAULT;
if (!tty || tty->magic != TTY_MAGIC)
- return rc;
+ return -EFAULT;
un = tty->driver_data;
if (!un || un->magic != DGNC_UNIT_MAGIC)
- return rc;
+ return -EFAULT;
ch = un->un_ch;
if (!ch || ch->magic != DGNC_CHANNEL_MAGIC)
- return rc;
+ return -EFAULT;
memset(&tmp, 0, sizeof(tmp));
spin_unlock_irqrestore(&ch->ch_lock, flags);
if (copy_to_user(retinfo, &tmp, sizeof(*retinfo)))
- return rc;
+ return -EFAULT;
return 0;
}
struct un_t *un;
struct digi_t new_digi;
unsigned long flags;
- int rc = -EFAULT;
if (!tty || tty->magic != TTY_MAGIC)
- return rc;
+ return -EFAULT;
un = tty->driver_data;
if (!un || un->magic != DGNC_UNIT_MAGIC)
- return rc;
+ return -EFAULT;
ch = un->un_ch;
if (!ch || ch->magic != DGNC_CHANNEL_MAGIC)
- return rc;
+ return -EFAULT;
bd = ch->ch_bd;
if (!bd || bd->magic != DGNC_BOARD_MAGIC)
- return rc;
+ return -EFAULT;
if (copy_from_user(&new_digi, new_info, sizeof(new_digi)))
- return rc;
+ return -EFAULT;
spin_lock_irqsave(&ch->ch_lock, flags);
struct board_ops *ch_bd_ops;
struct channel_t *ch;
struct un_t *un;
- int rc = -ENODEV;
+ int rc;
unsigned long flags;
void __user *uarg = (void __user *)arg;
if (!tty || tty->magic != TTY_MAGIC)
- return rc;
+ return -ENODEV;
un = tty->driver_data;
if (!un || un->magic != DGNC_UNIT_MAGIC)
- return rc;
+ return -ENODEV;
ch = un->un_ch;
if (!ch || ch->magic != DGNC_CHANNEL_MAGIC)
- return rc;
+ return -ENODEV;
bd = ch->ch_bd;
if (!bd || bd->magic != DGNC_BOARD_MAGIC)
- return rc;
+ return -ENODEV;
ch_bd_ops = bd->bd_ops;
rc = tty_check_change(tty);
spin_unlock_irqrestore(&ch->ch_lock, flags);
if (rc)
- return rc;
+ return -ENODEV;
rc = ch_bd_ops->drain(tty, 0);
rc = tty_check_change(tty);
spin_unlock_irqrestore(&ch->ch_lock, flags);
if (rc)
- return rc;
+ return -ENODEV;
rc = ch_bd_ops->drain(tty, 0);
if (rc)
rc = tty_check_change(tty);
spin_unlock_irqrestore(&ch->ch_lock, flags);
if (rc)
- return rc;
+ return -ENODEV;
rc = ch_bd_ops->drain(tty, 0);
if (rc)