make etrax serial driver register its device nodes, so we get a console
[openwrt/svn-archive/archive.git] / target / linux / etrax / patches / 300-sysfs.patch
1 Index: linux-2.6.25.1/drivers/serial/crisv10.c
2 ===================================================================
3 --- linux-2.6.25.1.orig/drivers/serial/crisv10.c 2008-05-03 20:54:24.000000000 +0100
4 +++ linux-2.6.25.1/drivers/serial/crisv10.c 2008-05-03 21:07:48.000000000 +0100
5 @@ -27,6 +27,7 @@
6 #include <linux/kernel.h>
7 #include <linux/mutex.h>
8 #include <linux/bitops.h>
9 +#include <linux/device.h>
10
11 #include <asm/io.h>
12 #include <asm/irq.h>
13 @@ -4384,6 +4385,7 @@
14 .tiocmset = rs_tiocmset
15 };
16
17 +static struct class *rs_class;
18 static int __init
19 rs_init(void)
20 {
21 @@ -4518,6 +4520,24 @@
22 #endif
23 #endif /* CONFIG_SVINTO_SIM */
24
25 + rs_class = class_create(THIS_MODULE, "rs_tty");
26 +#ifdef CONFIG_ETRAX_SERIAL_PORT0
27 + class_device_create(rs_class, NULL,
28 + MKDEV(TTY_MAJOR, 64), NULL, "ttyS0");
29 +#endif
30 +#ifdef CONFIG_ETRAX_SERIAL_PORT1
31 + class_device_create(rs_class, NULL,
32 + MKDEV(TTY_MAJOR, 65), NULL, "ttyS1");
33 +#endif
34 +#ifdef CONFIG_ETRAX_SERIAL_PORT2
35 + class_device_create(rs_class, NULL,
36 + MKDEV(TTY_MAJOR, 66), NULL, "ttyS2");
37 +#endif
38 +#ifdef CONFIG_ETRAX_SERIAL_PORT3
39 + class_device_create(rs_class, NULL,
40 + MKDEV(TTY_MAJOR, 67), NULL, "ttyS3");
41 +#endif
42 +
43 return 0;
44 }
45