git.openpandora.org
/
pandora-kernel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'devel' of master.kernel.org:/home/rmk/linux-2.6-serial
[pandora-kernel.git]
/
drivers
/
serial
/
serial_core.c
diff --git
a/drivers/serial/serial_core.c
b/drivers/serial/serial_core.c
index
372e47f
..
c67b05e
100644
(file)
--- a/
drivers/serial/serial_core.c
+++ b/
drivers/serial/serial_core.c
@@
-792,6
+792,7
@@
static int uart_set_info(struct uart_state *state,
* We failed anyway.
*/
retval = -EBUSY;
* We failed anyway.
*/
retval = -EBUSY;
+ goto exit; // Added to return the correct error -Ram Gupta
}
}
}
}
@@
-1662,16
+1663,16
@@
static int uart_line_info(char *buf, struct uart_driver *drv, int i)
struct uart_port *port = state->port;
char stat_buf[32];
unsigned int status;
struct uart_port *port = state->port;
char stat_buf[32];
unsigned int status;
- int ret;
+ int
mmio,
ret;
if (!port)
return 0;
if (!port)
return 0;
+ mmio = port->iotype >= UPIO_MEM;
ret = sprintf(buf, "%d: uart:%s %s%08lX irq:%d",
port->line, uart_type(port),
ret = sprintf(buf, "%d: uart:%s %s%08lX irq:%d",
port->line, uart_type(port),
- port->iotype == UPIO_MEM ? "mmio:0x" : "port:",
- port->iotype == UPIO_MEM ? port->mapbase :
- (unsigned long) port->iobase,
+ mmio ? "mmio:0x" : "port:",
+ mmio ? port->mapbase : (unsigned long) port->iobase,
port->irq);
if (port->type == PORT_UNKNOWN) {
port->irq);
if (port->type == PORT_UNKNOWN) {
@@
-1929,9
+1930,19
@@
int uart_suspend_port(struct uart_driver *drv, struct uart_port *port)
mutex_lock(&state->mutex);
mutex_lock(&state->mutex);
+#ifdef CONFIG_DISABLE_CONSOLE_SUSPEND
+ if (uart_console(port)) {
+ mutex_unlock(&state->mutex);
+ return 0;
+ }
+#endif
+
if (state->info && state->info->flags & UIF_INITIALIZED) {
const struct uart_ops *ops = port->ops;
if (state->info && state->info->flags & UIF_INITIALIZED) {
const struct uart_ops *ops = port->ops;
+ state->info->flags = (state->info->flags & ~UIF_INITIALIZED)
+ | UIF_SUSPENDED;
+
spin_lock_irq(&port->lock);
ops->stop_tx(port);
ops->set_mctrl(port, 0);
spin_lock_irq(&port->lock);
ops->stop_tx(port);
ops->set_mctrl(port, 0);
@@
-1967,6
+1978,13
@@
int uart_resume_port(struct uart_driver *drv, struct uart_port *port)
mutex_lock(&state->mutex);
mutex_lock(&state->mutex);
+#ifdef CONFIG_DISABLE_CONSOLE_SUSPEND
+ if (uart_console(port)) {
+ mutex_unlock(&state->mutex);
+ return 0;
+ }
+#endif
+
uart_change_pm(state, 0);
/*
uart_change_pm(state, 0);
/*
@@
-1991,7
+2009,7
@@
int uart_resume_port(struct uart_driver *drv, struct uart_port *port)
console_start(port->cons);
}
console_start(port->cons);
}
- if (state->info && state->info->flags & UIF_
INITIALIZ
ED) {
+ if (state->info && state->info->flags & UIF_
SUSPEND
ED) {
const struct uart_ops *ops = port->ops;
int ret;
const struct uart_ops *ops = port->ops;
int ret;
@@
-2003,15
+2021,17
@@
int uart_resume_port(struct uart_driver *drv, struct uart_port *port)
ops->set_mctrl(port, port->mctrl);
ops->start_tx(port);
spin_unlock_irq(&port->lock);
ops->set_mctrl(port, port->mctrl);
ops->start_tx(port);
spin_unlock_irq(&port->lock);
+ state->info->flags |= UIF_INITIALIZED;
} else {
/*
* Failed to resume - maybe hardware went away?
* Clear the "initialized" flag so we won't try
* to call the low level drivers shutdown method.
*/
} else {
/*
* Failed to resume - maybe hardware went away?
* Clear the "initialized" flag so we won't try
* to call the low level drivers shutdown method.
*/
- state->info->flags &= ~UIF_INITIALIZED;
uart_shutdown(state);
}
uart_shutdown(state);
}
+
+ state->info->flags &= ~UIF_SUSPENDED;
}
mutex_unlock(&state->mutex);
}
mutex_unlock(&state->mutex);
@@
-2097,7
+2117,7
@@
uart_configure_port(struct uart_driver *drv, struct uart_state *state,
}
}
}
}
-static struct tty_operations uart_ops = {
+static
const
struct tty_operations uart_ops = {
.open = uart_open,
.close = uart_close,
.write = uart_write,
.open = uart_open,
.close = uart_close,
.write = uart_write,