summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell King <rmk@flint.arm.linux.org.uk>2002-12-01 15:37:49 +0000
committerRussell King <rmk@flint.arm.linux.org.uk>2002-12-01 15:37:49 +0000
commitb1a5ffda2f93d79f9e9aa7f478edd6e732748075 (patch)
tree95358cb30c5b80712896f0a41d3509df549dde67
parente75784be0a412631b310e8c6ba3d88a4c11e186e (diff)
[SERIAL] Move custom_divisor from uart_state to uart_port.
This is another step towards moving the divisor calculations into the low level drivers, thereby allowing the faster baud rates mentioned in the previous cset. Moving this field to uart_port means that the low level drivers do not have to know about the uart_state structure.
-rw-r--r--drivers/serial/core.c12
-rw-r--r--include/linux/serial_core.h3
2 files changed, 7 insertions, 8 deletions
diff --git a/drivers/serial/core.c b/drivers/serial/core.c
index c51ffbdc349c..ad247096e6ed 100644
--- a/drivers/serial/core.c
+++ b/drivers/serial/core.c
@@ -309,7 +309,7 @@ unsigned int uart_calculate_quot(struct uart_info *info, unsigned int baud)
/* Old HI/VHI/custom speed handling */
if (baud == 38400 &&
((port->flags & UPF_SPD_MASK) == UPF_SPD_CUST))
- quot = info->state->custom_divisor;
+ quot = port->custom_divisor;
else
quot = port->uartclk / (16 * baud);
@@ -617,7 +617,7 @@ static int uart_get_info(struct uart_info *info, struct serial_struct *retinfo)
tmp.baud_base = port->uartclk / 16;
tmp.close_delay = state->close_delay;
tmp.closing_wait = state->closing_wait;
- tmp.custom_divisor = state->custom_divisor;
+ tmp.custom_divisor = port->custom_divisor;
tmp.hub6 = port->hub6;
tmp.io_type = port->iotype;
tmp.iomem_reg_shift = port->regshift;
@@ -672,7 +672,7 @@ uart_set_info(struct uart_info *info, struct serial_struct *newinfo)
new_serial.type != port->type;
old_flags = port->flags;
- old_custom_divisor = state->custom_divisor;
+ old_custom_divisor = port->custom_divisor;
if (!capable(CAP_SYS_ADMIN)) {
retval = -EPERM;
@@ -685,7 +685,7 @@ uart_set_info(struct uart_info *info, struct serial_struct *newinfo)
goto exit;
port->flags = ((port->flags & ~UPF_USR_MASK) |
(new_serial.flags & UPF_USR_MASK));
- state->custom_divisor = new_serial.custom_divisor;
+ port->custom_divisor = new_serial.custom_divisor;
goto check_and_exit;
}
@@ -777,7 +777,7 @@ uart_set_info(struct uart_info *info, struct serial_struct *newinfo)
port->irq = new_serial.irq;
port->uartclk = new_serial.baud_base * 16;
port->flags = new_serial.flags & UPF_FLAGS;
- state->custom_divisor = new_serial.custom_divisor;
+ port->custom_divisor = new_serial.custom_divisor;
state->close_delay = new_serial.close_delay * HZ / 100;
state->closing_wait = new_serial.closing_wait * HZ / 100;
port->fifosize = new_serial.xmit_fifo_size;
@@ -789,7 +789,7 @@ uart_set_info(struct uart_info *info, struct serial_struct *newinfo)
goto exit;
if (info->flags & UIF_INITIALIZED) {
if (((old_flags ^ port->flags) & UPF_SPD_MASK) ||
- old_custom_divisor != state->custom_divisor)
+ old_custom_divisor != port->custom_divisor)
uart_change_speed(info, NULL);
} else
retval = uart_startup(info, 1);
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index fe25d0fa6b94..84e021607be9 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -186,6 +186,7 @@ struct uart_port {
unsigned int timeout; /* character-based timeout */
unsigned int type; /* port type */
struct uart_ops *ops;
+ unsigned int custom_divisor;
unsigned int line; /* port index */
unsigned long mapbase; /* for ioremap */
unsigned char hub6; /* this should be in the 8250 driver */
@@ -204,8 +205,6 @@ struct uart_state {
#define USF_CLOSING_WAIT_INF (0)
#define USF_CLOSING_WAIT_NONE (65535)
- unsigned int custom_divisor;
-
int count;
struct uart_info *info;
struct uart_port *port;