300-sysfs.patch 977 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. --- a/drivers/serial/crisv10.c
  2. +++ b/drivers/serial/crisv10.c
  3. @@ -27,6 +27,7 @@
  4. #include <linux/kernel.h>
  5. #include <linux/mutex.h>
  6. #include <linux/bitops.h>
  7. +#include <linux/device.h>
  8. #include <asm/io.h>
  9. #include <asm/irq.h>
  10. @@ -4384,6 +4385,7 @@
  11. .tiocmset = rs_tiocmset
  12. };
  13. +static struct class *rs_class;
  14. static int __init
  15. rs_init(void)
  16. {
  17. @@ -4518,6 +4520,24 @@
  18. #endif
  19. #endif /* CONFIG_SVINTO_SIM */
  20. + rs_class = class_create(THIS_MODULE, "rs_tty");
  21. +#ifdef CONFIG_ETRAX_SERIAL_PORT0
  22. + class_device_create(rs_class, NULL,
  23. + MKDEV(TTY_MAJOR, 64), NULL, "ttyS0");
  24. +#endif
  25. +#ifdef CONFIG_ETRAX_SERIAL_PORT1
  26. + class_device_create(rs_class, NULL,
  27. + MKDEV(TTY_MAJOR, 65), NULL, "ttyS1");
  28. +#endif
  29. +#ifdef CONFIG_ETRAX_SERIAL_PORT2
  30. + class_device_create(rs_class, NULL,
  31. + MKDEV(TTY_MAJOR, 66), NULL, "ttyS2");
  32. +#endif
  33. +#ifdef CONFIG_ETRAX_SERIAL_PORT3
  34. + class_device_create(rs_class, NULL,
  35. + MKDEV(TTY_MAJOR, 67), NULL, "ttyS3");
  36. +#endif
  37. +
  38. return 0;
  39. }