Commit 77bdec6f authored by Jiri Slaby's avatar Jiri Slaby Committed by Greg Kroah-Hartman

serial: at91, fix rs485 properties

There is a misplaced bracket in atmel_init_rs485 which sets
rs485-rx-during-tx and rs485-enabled-at-boot-time only if
rs485-rts-delay is set in of.

This is clearly a bug, so fix it by moving the bracket to the proper
place.
Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
Cc: Elen Song <elen.song@atmel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f148d6d7
...@@ -1682,15 +1682,15 @@ static void atmel_init_rs485(struct uart_port *port, ...@@ -1682,15 +1682,15 @@ static void atmel_init_rs485(struct uart_port *port,
struct atmel_uart_data *pdata = dev_get_platdata(&pdev->dev); struct atmel_uart_data *pdata = dev_get_platdata(&pdev->dev);
if (np) { if (np) {
struct serial_rs485 *rs485conf = &port->rs485;
u32 rs485_delay[2]; u32 rs485_delay[2];
/* rs485 properties */ /* rs485 properties */
if (of_property_read_u32_array(np, "rs485-rts-delay", if (of_property_read_u32_array(np, "rs485-rts-delay",
rs485_delay, 2) == 0) { rs485_delay, 2) == 0) {
struct serial_rs485 *rs485conf = &port->rs485;
rs485conf->delay_rts_before_send = rs485_delay[0]; rs485conf->delay_rts_before_send = rs485_delay[0];
rs485conf->delay_rts_after_send = rs485_delay[1]; rs485conf->delay_rts_after_send = rs485_delay[1];
rs485conf->flags = 0; rs485conf->flags = 0;
}
if (of_get_property(np, "rs485-rx-during-tx", NULL)) if (of_get_property(np, "rs485-rx-during-tx", NULL))
rs485conf->flags |= SER_RS485_RX_DURING_TX; rs485conf->flags |= SER_RS485_RX_DURING_TX;
...@@ -1698,7 +1698,6 @@ static void atmel_init_rs485(struct uart_port *port, ...@@ -1698,7 +1698,6 @@ static void atmel_init_rs485(struct uart_port *port,
if (of_get_property(np, "linux,rs485-enabled-at-boot-time", if (of_get_property(np, "linux,rs485-enabled-at-boot-time",
NULL)) NULL))
rs485conf->flags |= SER_RS485_ENABLED; rs485conf->flags |= SER_RS485_ENABLED;
}
} else { } else {
port->rs485 = pdata->rs485; port->rs485 = pdata->rs485;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment