hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/tty/serial/sunsab.c
....@@ -40,10 +40,6 @@
4040 #include <asm/prom.h>
4141 #include <asm/setup.h>
4242
43
-#if defined(CONFIG_SERIAL_SUNSAB_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
44
-#define SUPPORT_SYSRQ
45
-#endif
46
-
4743 #include <linux/serial_core.h>
4844 #include <linux/sunserialcore.h>
4945
....@@ -890,7 +886,7 @@
890886 * though...
891887 */
892888 if (up->port.type != PORT_SUNSAB)
893
- return -1;
889
+ return -EINVAL;
894890
895891 printk("Console: ttyS%d (SAB82532)\n",
896892 (sunsab_reg.minor - 64) + con->index);
....@@ -985,6 +981,7 @@
985981
986982 up->port.fifosize = SAB82532_XMIT_FIFO_SIZE;
987983 up->port.iotype = UPIO_MEM;
984
+ up->port.has_sysrq = IS_ENABLED(CONFIG_SERIAL_SUNSAB_CONSOLE);
988985
989986 writeb(SAB82532_IPC_IC_ACT_LOW, &up->regs->w.ipc);
990987
....@@ -1140,7 +1137,13 @@
11401137 }
11411138 }
11421139
1143
- return platform_driver_register(&sab_driver);
1140
+ err = platform_driver_register(&sab_driver);
1141
+ if (err) {
1142
+ kfree(sunsab_ports);
1143
+ sunsab_ports = NULL;
1144
+ }
1145
+
1146
+ return err;
11441147 }
11451148
11461149 static void __exit sunsab_exit(void)