struct uart_state *state = tty->driver_data;
struct uart_port *port = state->port;
- BUG_ON(!kernel_locked());
-
+ lock_kernel();
mutex_lock(&state->mutex);
if (port->type != PORT_UNKNOWN)
port->ops->break_ctl(port, break_state);
mutex_unlock(&state->mutex);
+ unlock_kernel();
}
static int uart_do_autoconfig(struct uart_state *state)
}
/*
- * Called via sys_ioctl under the BKL. We can use spin_lock_irq() here.
+ * Called via sys_ioctl. We can use spin_lock_irq() here.
*/
static int
uart_ioctl(struct tty_struct *tty, struct file *filp, unsigned int cmd,
void __user *uarg = (void __user *)arg;
int ret = -ENOIOCTLCMD;
- BUG_ON(!kernel_locked());
+ lock_kernel();
/*
* These ioctls don't rely on the hardware to be present.
*/
out_up:
mutex_unlock(&state->mutex);
out:
+ unlock_kernel();
return ret;
}
unsigned long flags;
unsigned int cflag = tty->termios->c_cflag;
- BUG_ON(!kernel_locked());
/*
* These are the bits that are used to setup various
if ((cflag ^ old_termios->c_cflag) == 0 &&
tty->termios->c_ospeed == old_termios->c_ospeed &&
tty->termios->c_ispeed == old_termios->c_ispeed &&
- RELEVANT_IFLAG(tty->termios->c_iflag ^ old_termios->c_iflag) == 0)
+ RELEVANT_IFLAG(tty->termios->c_iflag ^ old_termios->c_iflag) == 0) {
return;
+ }
+ lock_kernel();
uart_change_speed(state, old_termios);
/* Handle transition to B0 status */
}
spin_unlock_irqrestore(&state->port->lock, flags);
}
-
+ unlock_kernel();
#if 0
/*
* No need to wake up processes in open wait, since they