summaryrefslogtreecommitdiff
path: root/patches/collateral-evolutions/network/0061-termios_rwsem/nfc.patch
blob: 73714151a2f83ab2b340dcadea5c582569033116 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
--- a/net/nfc/nci/uart.c
+++ b/net/nfc/nci/uart.c
@@ -439,9 +439,17 @@ void nci_uart_set_config(struct nci_uart
 	if (!nu->tty)
 		return;
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)
 	down_read(&nu->tty->termios_rwsem);
+#else
+	mutex_lock(&nu->tty->termios_mutex);
+#endif /* if LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0) */
 	new_termios = nu->tty->termios;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)
 	up_read(&nu->tty->termios_rwsem);
+#else
+	mutex_unlock(&nu->tty->termios_mutex);
+#endif /* if LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0) */
 	tty_termios_encode_baud_rate(&new_termios, baudrate, baudrate);
 
 	if (flow_ctrl)