Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 31812
b: refs/heads/master
c: 13e8359
h: refs/heads/master
v: v3
  • Loading branch information
Ingo Molnar authored and Linus Torvalds committed Jul 3, 2006
1 parent ac748fc commit 566cd2b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d8aa905b429700e8b6b6b301a8ac2d4a24f2c19b
refs/heads/master: 13e83599d282ddfd544600df9db5ab343ac4662f
11 changes: 10 additions & 1 deletion trunk/drivers/serial/serial_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@
*/
static DEFINE_MUTEX(port_mutex);

/*
* lockdep: port->lock is initialized in two places, but we
* want only one lock-class:
*/
static struct lock_class_key port_lock_key;

#define HIGH_BITS_OFFSET ((sizeof(long)-sizeof(int))*8)

#define uart_users(state) ((state)->count + ((state)->info ? (state)->info->blocked_open : 0))
Expand Down Expand Up @@ -1865,6 +1871,7 @@ uart_set_options(struct uart_port *port, struct console *co,
* early.
*/
spin_lock_init(&port->lock);
lockdep_set_class(&port->lock, &port_lock_key);

memset(&termios, 0, sizeof(struct termios));

Expand Down Expand Up @@ -2247,8 +2254,10 @@ int uart_add_one_port(struct uart_driver *drv, struct uart_port *port)
* If this port is a console, then the spinlock is already
* initialised.
*/
if (!(uart_console(port) && (port->cons->flags & CON_ENABLED)))
if (!(uart_console(port) && (port->cons->flags & CON_ENABLED))) {
spin_lock_init(&port->lock);
lockdep_set_class(&port->lock, &port_lock_key);
}

uart_configure_port(drv, state, port);

Expand Down

0 comments on commit 566cd2b

Please sign in to comment.