Skip to content

Commit bbc8218

Browse files
committed
Merge tag 'tty-5.10-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty
Pull tty/serial fixes from Greg KH: "Here are a small number of small tty and serial fixes for some reported problems for the tty core, vt code, and some serial drivers. They include fixes for: - a buggy and obsolete vt font ioctl removal - 8250_mtk serial baudrate runtime warnings - imx serial earlycon build configuration fix - txx9 serial driver error path cleanup issues - tty core fix in release_tty that can be triggered by trying to bind an invalid serial port name to a speakup console device Almost all of these have been in linux-next without any problems, the only one that hasn't, just deletes code :)" * tag 'tty-5.10-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: vt: Disable KD_FONT_OP_COPY tty: fix crash in release_tty if tty->port is not set serial: txx9: add missing platform_driver_unregister() on error in serial_txx9_init tty: serial: imx: enable earlycon by default if IMX_SERIAL_CONSOLE is enabled serial: 8250_mtk: Fix uart_get_baud_rate warning
2 parents df53b81 + 3c4e0df commit bbc8218

File tree

5 files changed

+11
-25
lines changed

5 files changed

+11
-25
lines changed

drivers/tty/serial/8250/8250_mtk.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ mtk8250_set_termios(struct uart_port *port, struct ktermios *termios,
317317
*/
318318
baud = tty_termios_baud_rate(termios);
319319

320-
serial8250_do_set_termios(port, termios, old);
320+
serial8250_do_set_termios(port, termios, NULL);
321321

322322
tty_termios_encode_baud_rate(termios, baud, baud);
323323

drivers/tty/serial/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,7 @@ config SERIAL_IMX_EARLYCON
522522
depends on OF
523523
select SERIAL_EARLYCON
524524
select SERIAL_CORE_CONSOLE
525+
default y if SERIAL_IMX_CONSOLE
525526
help
526527
If you have enabled the earlycon on the Freescale IMX
527528
CPU you can make it the earlycon by answering Y to this option.

drivers/tty/serial/serial_txx9.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1280,6 +1280,9 @@ static int __init serial_txx9_init(void)
12801280

12811281
#ifdef ENABLE_SERIAL_TXX9_PCI
12821282
ret = pci_register_driver(&serial_txx9_pci_driver);
1283+
if (ret) {
1284+
platform_driver_unregister(&serial_txx9_plat_driver);
1285+
}
12831286
#endif
12841287
if (ret == 0)
12851288
goto out;

drivers/tty/tty_io.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1515,10 +1515,12 @@ static void release_tty(struct tty_struct *tty, int idx)
15151515
tty->ops->shutdown(tty);
15161516
tty_save_termios(tty);
15171517
tty_driver_remove_tty(tty->driver, tty);
1518-
tty->port->itty = NULL;
1518+
if (tty->port)
1519+
tty->port->itty = NULL;
15191520
if (tty->link)
15201521
tty->link->port->itty = NULL;
1521-
tty_buffer_cancel_work(tty->port);
1522+
if (tty->port)
1523+
tty_buffer_cancel_work(tty->port);
15221524
if (tty->link)
15231525
tty_buffer_cancel_work(tty->link->port);
15241526

drivers/tty/vt/vt.c

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4704,27 +4704,6 @@ static int con_font_default(struct vc_data *vc, struct console_font_op *op)
47044704
return rc;
47054705
}
47064706

4707-
static int con_font_copy(struct vc_data *vc, struct console_font_op *op)
4708-
{
4709-
int con = op->height;
4710-
int rc;
4711-
4712-
4713-
console_lock();
4714-
if (vc->vc_mode != KD_TEXT)
4715-
rc = -EINVAL;
4716-
else if (!vc->vc_sw->con_font_copy)
4717-
rc = -ENOSYS;
4718-
else if (con < 0 || !vc_cons_allocated(con))
4719-
rc = -ENOTTY;
4720-
else if (con == vc->vc_num) /* nothing to do */
4721-
rc = 0;
4722-
else
4723-
rc = vc->vc_sw->con_font_copy(vc, con);
4724-
console_unlock();
4725-
return rc;
4726-
}
4727-
47284707
int con_font_op(struct vc_data *vc, struct console_font_op *op)
47294708
{
47304709
switch (op->op) {
@@ -4735,7 +4714,8 @@ int con_font_op(struct vc_data *vc, struct console_font_op *op)
47354714
case KD_FONT_OP_SET_DEFAULT:
47364715
return con_font_default(vc, op);
47374716
case KD_FONT_OP_COPY:
4738-
return con_font_copy(vc, op);
4717+
/* was buggy and never really used */
4718+
return -EINVAL;
47394719
}
47404720
return -ENOSYS;
47414721
}

0 commit comments

Comments
 (0)