GIT 7493a314cb83797ce612a577475aacaedc553fed git+ssh://master.kernel.org/home/rmk/linux-2.6-serial.git commit 7493a314cb83797ce612a577475aacaedc553fed Author: Dmitry Torokhov Date: Fri Jan 13 22:06:43 2006 +0000 [SERIAL] serial8250: convert to the new platform device interface Do not use platform_device_register_simple() as it is going away. Also set up driver's owner to create link driver->module in sysfs. Signed-off-by: Dmitry Torokhov Signed-off-by: Russell King commit d600b97cf6ef8c24c9b87a4b7ce390c0d13684e8 Author: Adrian Bunk Date: Fri Jan 13 21:57:22 2006 +0000 [SERIAL] fix SERIAL_M32R_PLDSIO dependencies This patch fixes a typo in the dependencies reported by Jean-Luc Leger . Signed-off-by: Adrian Bunk Signed-off-by: Russell King commit e2862f6a833ea26591c7feb755dc2e46909182a6 Author: Ingo Molnar Date: Fri Jan 13 21:37:07 2006 +0000 [SERIAL] convert uart_state.sem to uart_state.mutex semaphore to mutex conversion. the conversion was generated via scripts, and the result was validated automatically via a script as well. build and boot tested. Signed-off-by: Ingo Molnar Signed-off-by: Russell King --- Signed-off-by: Andrew Morton --- drivers/serial/Kconfig | 2 - drivers/serial/pmac_zilog.c | 9 ++-- drivers/serial/serial_core.c | 60 ++++++++++++++++----------------- include/linux/serial_core.h | 3 + serial/8250.c | 0 5 files changed, 37 insertions(+), 37 deletions(-) diff -puN drivers/serial/8250.c~git-serial drivers/serial/8250.c diff -puN drivers/serial/Kconfig~git-serial drivers/serial/Kconfig --- devel/drivers/serial/Kconfig~git-serial 2006-01-14 01:07:37.000000000 -0800 +++ devel-akpm/drivers/serial/Kconfig 2006-01-14 01:07:39.000000000 -0800 @@ -847,7 +847,7 @@ config SERIAL_M32R_SIO_CONSOLE config SERIAL_M32R_PLDSIO bool "M32R SIO I/F on a PLD" - depends on SERIAL_M32R_SIO=y && (PLAT_OPSPUT || PALT_USRV || PLAT_M32700UT) + depends on SERIAL_M32R_SIO=y && (PLAT_OPSPUT || PLAT_USRV || PLAT_M32700UT) default n help Say Y here if you want to use the M32R serial controller diff -puN drivers/serial/pmac_zilog.c~git-serial drivers/serial/pmac_zilog.c --- devel/drivers/serial/pmac_zilog.c~git-serial 2006-01-14 01:07:37.000000000 -0800 +++ devel-akpm/drivers/serial/pmac_zilog.c 2006-01-14 01:07:39.000000000 -0800 @@ -69,7 +69,6 @@ #include #include #include -#include #if defined (CONFIG_SERIAL_PMACZILOG_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) #define SUPPORT_SYSRQ @@ -1593,7 +1592,7 @@ static int pmz_suspend(struct macio_dev state = pmz_uart_reg.state + uap->port.line; mutex_lock(&pmz_irq_mutex); - down(&state->sem); + mutex_lock(&state->mutex); spin_lock_irqsave(&uap->port.lock, flags); @@ -1624,7 +1623,7 @@ static int pmz_suspend(struct macio_dev /* Shut the chip down */ pmz_set_scc_power(uap, 0); - up(&state->sem); + mutex_unlock(&state->mutex); mutex_unlock(&pmz_irq_mutex); pmz_debug("suspend, switching complete\n"); @@ -1653,7 +1652,7 @@ static int pmz_resume(struct macio_dev * state = pmz_uart_reg.state + uap->port.line; mutex_lock(&pmz_irq_mutex); - down(&state->sem); + mutex_lock(&state->mutex); spin_lock_irqsave(&uap->port.lock, flags); if (!ZS_IS_OPEN(uap) && !ZS_IS_CONS(uap)) { @@ -1685,7 +1684,7 @@ static int pmz_resume(struct macio_dev * } bail: - up(&state->sem); + mutex_unlock(&state->mutex); mutex_unlock(&pmz_irq_mutex); /* Right now, we deal with delay by blocking here, I'll be diff -puN drivers/serial/serial_core.c~git-serial drivers/serial/serial_core.c --- devel/drivers/serial/serial_core.c~git-serial 2006-01-14 01:07:37.000000000 -0800 +++ devel-akpm/drivers/serial/serial_core.c 2006-01-14 01:07:39.000000000 -0800 @@ -638,7 +638,7 @@ static int uart_set_info(struct uart_sta * module insertion/removal doesn't change anything * under us. */ - down(&state->sem); + mutex_lock(&state->mutex); change_irq = new_serial.irq != port->irq; @@ -797,7 +797,7 @@ static int uart_set_info(struct uart_sta } else retval = uart_startup(state, 1); exit: - up(&state->sem); + mutex_unlock(&state->mutex); return retval; } @@ -834,7 +834,7 @@ static int uart_tiocmget(struct tty_stru struct uart_port *port = state->port; int result = -EIO; - down(&state->sem); + mutex_lock(&state->mutex); if ((!file || !tty_hung_up_p(file)) && !(tty->flags & (1 << TTY_IO_ERROR))) { result = port->mctrl; @@ -843,7 +843,7 @@ static int uart_tiocmget(struct tty_stru result |= port->ops->get_mctrl(port); spin_unlock_irq(&port->lock); } - up(&state->sem); + mutex_unlock(&state->mutex); return result; } @@ -856,13 +856,13 @@ uart_tiocmset(struct tty_struct *tty, st struct uart_port *port = state->port; int ret = -EIO; - down(&state->sem); + mutex_lock(&state->mutex); if ((!file || !tty_hung_up_p(file)) && !(tty->flags & (1 << TTY_IO_ERROR))) { uart_update_mctrl(port, set, clear); ret = 0; } - up(&state->sem); + mutex_unlock(&state->mutex); return ret; } @@ -873,12 +873,12 @@ static void uart_break_ctl(struct tty_st BUG_ON(!kernel_locked()); - down(&state->sem); + mutex_lock(&state->mutex); if (port->type != PORT_UNKNOWN) port->ops->break_ctl(port, break_state); - up(&state->sem); + mutex_unlock(&state->mutex); } static int uart_do_autoconfig(struct uart_state *state) @@ -894,7 +894,7 @@ static int uart_do_autoconfig(struct uar * changing, and hence any extra opens of the port while * we're auto-configuring. */ - if (down_interruptible(&state->sem)) + if (mutex_lock_interruptible(&state->mutex)) return -ERESTARTSYS; ret = -EBUSY; @@ -920,7 +920,7 @@ static int uart_do_autoconfig(struct uar ret = uart_startup(state, 1); } - up(&state->sem); + mutex_unlock(&state->mutex); return ret; } @@ -1074,7 +1074,7 @@ uart_ioctl(struct tty_struct *tty, struc if (ret != -ENOIOCTLCMD) goto out; - down(&state->sem); + mutex_lock(&state->mutex); if (tty_hung_up_p(filp)) { ret = -EIO; @@ -1098,7 +1098,7 @@ uart_ioctl(struct tty_struct *tty, struc } } out_up: - up(&state->sem); + mutex_unlock(&state->mutex); out: return ret; } @@ -1186,7 +1186,7 @@ static void uart_close(struct tty_struct DPRINTK("uart_close(%d) called\n", port->line); - down(&state->sem); + mutex_lock(&state->mutex); if (tty_hung_up_p(filp)) goto done; @@ -1260,7 +1260,7 @@ static void uart_close(struct tty_struct wake_up_interruptible(&state->info->open_wait); done: - up(&state->sem); + mutex_unlock(&state->mutex); } static void uart_wait_until_sent(struct tty_struct *tty, int timeout) @@ -1334,7 +1334,7 @@ static void uart_hangup(struct tty_struc BUG_ON(!kernel_locked()); DPRINTK("uart_hangup(%d)\n", state->port->line); - down(&state->sem); + mutex_lock(&state->mutex); if (state->info && state->info->flags & UIF_NORMAL_ACTIVE) { uart_flush_buffer(tty); uart_shutdown(state); @@ -1344,7 +1344,7 @@ static void uart_hangup(struct tty_struc wake_up_interruptible(&state->info->open_wait); wake_up_interruptible(&state->info->delta_msr_wait); } - up(&state->sem); + mutex_unlock(&state->mutex); } /* @@ -1447,9 +1447,9 @@ uart_block_til_ready(struct file *filp, if (mctrl & TIOCM_CAR) break; - up(&state->sem); + mutex_unlock(&state->mutex); schedule(); - down(&state->sem); + mutex_lock(&state->mutex); if (signal_pending(current)) break; @@ -1475,7 +1475,7 @@ static struct uart_state *uart_get(struc mutex_lock(&port_mutex); state = drv->state + line; - if (down_interruptible(&state->sem)) { + if (mutex_lock_interruptible(&state->mutex)) { state = ERR_PTR(-ERESTARTSYS); goto out; } @@ -1483,7 +1483,7 @@ static struct uart_state *uart_get(struc state->count++; if (!state->port) { state->count--; - up(&state->sem); + mutex_unlock(&state->mutex); state = ERR_PTR(-ENXIO); goto out; } @@ -1504,7 +1504,7 @@ static struct uart_state *uart_get(struc (unsigned long)state); } else { state->count--; - up(&state->sem); + mutex_unlock(&state->mutex); state = ERR_PTR(-ENOMEM); } } @@ -1571,7 +1571,7 @@ static int uart_open(struct tty_struct * if (tty_hung_up_p(filp)) { retval = -EAGAIN; state->count--; - up(&state->sem); + mutex_unlock(&state->mutex); goto fail; } @@ -1591,7 +1591,7 @@ static int uart_open(struct tty_struct * */ if (retval == 0) retval = uart_block_til_ready(filp, state); - up(&state->sem); + mutex_unlock(&state->mutex); /* * If this is the first open to succeed, adjust things to suit. @@ -1867,7 +1867,7 @@ int uart_suspend_port(struct uart_driver { struct uart_state *state = drv->state + port->line; - down(&state->sem); + mutex_lock(&state->mutex); if (state->info && state->info->flags & UIF_INITIALIZED) { struct uart_ops *ops = port->ops; @@ -1896,7 +1896,7 @@ int uart_suspend_port(struct uart_driver uart_change_pm(state, 3); - up(&state->sem); + mutex_unlock(&state->mutex); return 0; } @@ -1905,7 +1905,7 @@ int uart_resume_port(struct uart_driver { struct uart_state *state = drv->state + port->line; - down(&state->sem); + mutex_lock(&state->mutex); uart_change_pm(state, 0); @@ -1954,7 +1954,7 @@ int uart_resume_port(struct uart_driver } } - up(&state->sem); + mutex_unlock(&state->mutex); return 0; } @@ -2049,7 +2049,7 @@ uart_unconfigure_port(struct uart_driver if (info && info->tty) tty_vhangup(info->tty); - down(&state->sem); + mutex_lock(&state->mutex); state->info = NULL; @@ -2072,7 +2072,7 @@ uart_unconfigure_port(struct uart_driver kfree(info); } - up(&state->sem); + mutex_unlock(&state->mutex); } static struct tty_operations uart_ops = { @@ -2161,7 +2161,7 @@ int uart_register_driver(struct uart_dri state->close_delay = 500; /* .5 seconds */ state->closing_wait = 30000; /* 30 seconds */ - init_MUTEX(&state->sem); + mutex_init(&state->mutex); } retval = tty_register_driver(normal); diff -puN include/linux/serial_core.h~git-serial include/linux/serial_core.h --- devel/include/linux/serial_core.h~git-serial 2006-01-14 01:07:37.000000000 -0800 +++ devel-akpm/include/linux/serial_core.h 2006-01-14 01:07:39.000000000 -0800 @@ -136,6 +136,7 @@ #include #include #include +#include struct uart_port; struct uart_info; @@ -284,7 +285,7 @@ struct uart_state { struct uart_info *info; struct uart_port *port; - struct semaphore sem; + struct mutex mutex; }; #define UART_XMIT_SIZE PAGE_SIZE _