Skip to content

Commit b3b2b63

Browse files
committed
Merge branch 'for-linus' of git://www.jni.nu/cris
* 'for-linus' of git://www.jni.nu/cris: CRIS: Add paths for CRISv10 serial driver CRIS: Fix RS485 delay handling. Add missing "struct" to in sizeof.
2 parents 90ae83f + 395bc51 commit b3b2b63

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1757,6 +1757,7 @@ L: [email protected]
17571757
W: http://developer.axis.com
17581758
S: Maintained
17591759
F: arch/cris/
1760+
F: drivers/serial/crisv10.*
17601761

17611762
CRYPTO API
17621763
M: Herbert Xu <[email protected]>

drivers/serial/crisv10.c

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1411,11 +1411,12 @@ e100_enable_rs485(struct tty_struct *tty, struct serial_rs485 *r)
14111411
CONFIG_ETRAX_RS485_LTC1387_RXEN_PORT_G_BIT, 1);
14121412
#endif
14131413

1414-
info->rs485.flags = r->flags;
1415-
if (r->delay_rts_before_send >= 1000)
1414+
info->rs485 = *r;
1415+
1416+
/* Maximum delay before RTS equal to 1000 */
1417+
if (info->rs485.delay_rts_before_send >= 1000)
14161418
info->rs485.delay_rts_before_send = 1000;
1417-
else
1418-
info->rs485.delay_rts_before_send = r->delay_rts_before_send;
1419+
14191420
/* printk("rts: on send = %i, after = %i, enabled = %i",
14201421
info->rs485.rts_on_send,
14211422
info->rs485.rts_after_sent,
@@ -3234,9 +3235,9 @@ rs_write(struct tty_struct *tty,
32343235
e100_disable_rx(info);
32353236
e100_enable_rx_irq(info);
32363237
#endif
3237-
3238-
if (info->rs485.delay_rts_before_send > 0)
3239-
msleep(info->rs485.delay_rts_before_send);
3238+
if ((info->rs485.flags & SER_RS485_RTS_BEFORE_SEND) &&
3239+
(info->rs485.delay_rts_before_send > 0))
3240+
msleep(info->rs485.delay_rts_before_send);
32403241
}
32413242
#endif /* CONFIG_ETRAX_RS485 */
32423243

@@ -3694,6 +3695,11 @@ rs_ioctl(struct tty_struct *tty, struct file * file,
36943695

36953696
rs485data.delay_rts_before_send = rs485ctrl.delay_rts_before_send;
36963697
rs485data.flags = 0;
3698+
if (rs485data.delay_rts_before_send != 0)
3699+
rs485data.flags |= SER_RS485_RTS_BEFORE_SEND;
3700+
else
3701+
rs485data.flags &= ~(SER_RS485_RTS_BEFORE_SEND);
3702+
36973703
if (rs485ctrl.enabled)
36983704
rs485data.flags |= SER_RS485_ENABLED;
36993705
else
@@ -3731,7 +3737,7 @@ rs_ioctl(struct tty_struct *tty, struct file * file,
37313737
/* This is the ioctl to get RS485 data from user-space */
37323738
if (copy_to_user((struct serial_rs485 *) arg,
37333739
rs485data,
3734-
sizeof(serial_rs485)))
3740+
sizeof(struct serial_rs485)))
37353741
return -EFAULT;
37363742
break;
37373743
}
@@ -4527,6 +4533,7 @@ static int __init rs_init(void)
45274533
/* Set sane defaults */
45284534
info->rs485.flags &= ~(SER_RS485_RTS_ON_SEND);
45294535
info->rs485.flags |= SER_RS485_RTS_AFTER_SEND;
4536+
info->rs485.flags &= ~(SER_RS485_RTS_BEFORE_SEND);
45304537
info->rs485.delay_rts_before_send = 0;
45314538
info->rs485.flags &= ~(SER_RS485_ENABLED);
45324539
#endif

0 commit comments

Comments
 (0)