summarylogtreecommitdiffstats
path: root/0000-kernel-4.18-proc_fops-to-proc_show.patch
blob: 3179dc230bb373d8831b21fadc0503a6c5fcb77c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
--- driver/serial_core.c.orig	2018-06-11 11:13:38.000000000 -0400
+++ driver/serial_core.c	2019-03-10 20:43:11.777035590 -0400
@@ -1885,10 +1885,11 @@ static int uart_proc_show(struct seq_fil
 	for (i = 0; i < drv->nr; i++)
 		uart_line_info(m, drv, i);
 	return 0;
 }
 
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(4,18,0))
 static int uart_proc_open(struct inode *inode, struct file *file)
 {
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0))
 	return single_open(file, uart_proc_show, PDE_DATA(inode));
 #else
@@ -1902,10 +1903,11 @@ static const struct file_operations uart
 	.read		= seq_read,
 	.llseek		= seq_lseek,
 	.release	= single_release,
 };
 #endif
+#endif
 
 #if defined(CONFIG_SERIAL_CORE_CONSOLE) || defined(CONFIG_CONSOLE_POLL)
 /*
  *	cti_uart_console_write - write a console message to a serial port
  *	@port: the port to write the message
@@ -2443,13 +2445,17 @@ static const struct tty_operations uart_
 	.stop		= uart_stop,
 	.start		= uart_start,
 	.hangup		= uart_hangup,
 	.break_ctl	= uart_break_ctl,
 	.wait_until_sent= uart_wait_until_sent,
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(4,18,0))
 #ifdef CONFIG_PROC_FS
 	.proc_fops	= &uart_proc_fops,
 #endif
+#else
+	.proc_show	= &uart_proc_show,
+#endif
 	.tiocmget	= uart_tiocmget,
 	.tiocmset	= uart_tiocmset,
 	.get_icount	= uart_get_icount,
 #ifdef CONFIG_CONSOLE_POLL
 	.poll_init	= uart_poll_init,