tty cleanup for 6.19 or later
Subsystems (12)
Jiri Slaby (SUSE)
maintainercover tty cleanup for 6.19 or later
Hi,
this is another couple of random cleanup patches over the tty drivers.
Jiri Slaby (SUSE) (6):
tty: vt: do not open code DIV_ROUND_UP()
serial: xilinx_uartps: drop cdns_uart::cdns_uart_driver
serial: drop SERIAL_8250_DEPRECATED_OPTIONS
serial: 8250: move skip_txen_test to core
serial: 8250: make share_irqs local to 8250_platform
serial: 8250_platform: simplify IRQF_SHARED handling
arch/arm/configs/aspeed_g4_defconfig | 1 - arch/arm/configs/aspeed_g5_defconfig | 1 - arch/arm/configs/hisi_defconfig | 1 - arch/arm/configs/lpc18xx_defconfig | 1 - arch/arm/configs/shmobile_defconfig | 1 - arch/mips/configs/bcm47xx_defconfig | 1 - arch/mips/configs/bmips_stb_defconfig | 1 - arch/mips/configs/gcw0_defconfig | 1 - arch/nios2/configs/10m50_defconfig | 1 - arch/parisc/configs/generic-32bit_defconfig | 1 - arch/parisc/configs/generic-64bit_defconfig | 1 - arch/powerpc/configs/44x/akebono_defconfig | 1 - arch/powerpc/configs/microwatt_defconfig | 1 - arch/riscv/configs/nommu_virt_defconfig | 1 - arch/xtensa/configs/audio_kc705_defconfig | 1 - arch/xtensa/configs/generic_kc705_defconfig | 1 - arch/xtensa/configs/nommu_kc705_defconfig | 1 - arch/xtensa/configs/smp_lx200_defconfig | 1 - arch/xtensa/configs/xip_kc705_defconfig | 1 - drivers/tty/serial/8250/8250.h | 9 ---- drivers/tty/serial/8250/8250_core.c | 4 ++ drivers/tty/serial/8250/8250_platform.c | 55 +++++---------------- drivers/tty/serial/8250/8250_rsa.c | 24 --------- drivers/tty/serial/8250/Kconfig | 17 ------- drivers/tty/serial/xilinx_uartps.c | 15 ++---- drivers/tty/vt/vt.c | 4 +- 26 files changed, 22 insertions(+), 125 deletions(-)
Signature · 1 line
2.51.1
Jiri Slaby (SUSE)
maintainerPATCH 1/6 tty: vt: do not open code DIV_ROUND_UP()
Use the designated DIV_ROUND_UP() macro instead of explicit addition with division.
--- drivers/tty/vt/vt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/tty/vt/vt.c +2 -2
@@ -4862,7 +4862,7 @@ static int con_font_get(struct vc_data *vc, struct console_font_op *op)return ret; } - c = (font.width+7 )/8 * vpitch * font.charcount; + c =DIV_ROUND_UP (font.width,8 ) * vpitch * font.charcount;if (op->data && font.charcount > op->charcount)return -ENOSPC ;
@@ -4894,7 +4894,7 @@ static int con_font_set(struct vc_data *vc, const struct console_font_op *op)return -EINVAL ;if (vpitch < op->height)return -EINVAL ; - size = (op->width+7 )/8 * vpitch * op->charcount; + size =DIV_ROUND_UP (op->width,8 ) * vpitch * op->charcount;if (size > max_font_size)return -ENOSPC ;
Signature · 1 line
2.51.1
Jiri Slaby (SUSE)
maintainerPATCH 2/6 serial: xilinx_uartps: drop cdns_uart::cdns_uart_driver
In reply to Jiri Slaby (SUSE)Provided the uart driver is available globally, there is no need to store a pointer to it in struct cdns_uart. Instead, use the global cdns_uart_uart_driver in the code directly.
---
Cc: Michal Simek <[email protected]>
Cc: [email protected]
--- drivers/tty/serial/xilinx_uartps.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-)
drivers/tty/serial/xilinx_uartps.c +5 -10
@@ -190,7 +190,6 @@ MODULE_PARM_DESC(rx_timeout, "Rx timeout, 1-255");* @port: Pointer to the UART port * @uartclk: Reference clock * @pclk: APB clock -* @cdns_uart_driver: Pointer to UART driver * @baud: Current baud rate * @clk_rate_change_nb: Notifier block for clock changes * @quirks: Flags for RXBS support.
@@ -204,7 +203,6 @@ struct cdns_uart {struct uart_port *port;struct clk *uartclk;struct clk *pclk; -struct uart_driver *cdns_uart_driver;unsigned int baud;struct notifier_block clk_rate_change_nb;u32 quirks;
@@ -1465,7 +1463,6 @@ static struct console cdns_uart_console = {static int cdns_uart_suspend (struct device *device) {struct uart_port *port =dev_get_drvdata (device); -struct cdns_uart *cdns_uart = port->private_data;int may_wake; may_wake =device_may_wakeup (device);
@@ -1489,7 +1486,7 @@ static int cdns_uart_suspend(struct device *device)* Call the API provided in serial_core.c file which handles * the suspend. */ -return uart_suspend_port (cdns_uart->cdns_uart_driver, port); +return uart_suspend_port (&cdns_uart_uart_driver, port); }/**
@@ -1550,7 +1547,7 @@ static int cdns_uart_resume(struct device *device) uart_port_unlock_irqrestore(port, flags); } -return uart_resume_port (cdns_uart->cdns_uart_driver, port); +return uart_resume_port (&cdns_uart_uart_driver, port); }#endif /* ! CONFIG_PM_SLEEP */ static int __maybe_unused cdns_runtime_suspend (struct device *dev)
@@ -1686,8 +1683,6 @@ static int cdns_uart_probe(struct platform_device *pdev) } } - cdns_uart_data->cdns_uart_driver = &cdns_uart_uart_driver; - match =of_match_node (cdns_uart_of_match, pdev->dev.of_node);if (match && match->data) {const struct cdns_platform_data *data = match->data;
@@ -1862,7 +1857,7 @@ static int cdns_uart_probe(struct platform_device *pdev)clk_disable_unprepare (cdns_uart_data->pclk); err_out_unregister_driver:if (!instances) -uart_unregister_driver (cdns_uart_data->cdns_uart_driver); +uart_unregister_driver (&cdns_uart_uart_driver);return rc; }
@@ -1880,7 +1875,7 @@ static void cdns_uart_remove(struct platform_device *pdev)clk_notifier_unregister (cdns_uart_data->uartclk, &cdns_uart_data->clk_rate_change_nb);#endif -uart_remove_one_port (cdns_uart_data->cdns_uart_driver, port); +uart_remove_one_port (&cdns_uart_uart_driver, port); port->mapbase =0 ;clk_disable_unprepare (cdns_uart_data->uartclk);clk_disable_unprepare (cdns_uart_data->pclk);
@@ -1896,7 +1891,7 @@ static void cdns_uart_remove(struct platform_device *pdev)reset_control_assert (cdns_uart_data->rstc);if (!--instances) -uart_unregister_driver (cdns_uart_data->cdns_uart_driver); +uart_unregister_driver (&cdns_uart_uart_driver); }static struct platform_driver cdns_uart_platform_driver = {
Signature · 1 line
2.51.1
Re: [PATCH 2/6] serial: xilinx_uartps: drop cdns_uart::cdns_uart_driver
Quoted 86 lines · Jiri Slaby (SUSE)
Provided the uart driver is available globally, there is no need to store a pointer to it in struct
cdns_uart. Instead, use the globalcdns_uart_uart_driverin the code directly.Signed-off-by Jiri Slaby (SUSE) <[email protected]>---
Cc: Michal Simek <[email protected]>
Cc: [email protected]--- drivers/tty/serial/xilinx_uartps.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-)drivers/tty/serial/xilinx_uartps.c +4
-9@@ -190,7 +190,6 @@ MODULE_PARM_DESC(rx_timeout, "Rx timeout, 1-255");* @port: Pointer to the UART port * @uartclk: Reference clock * @pclk: APB clock -* @cdns_uart_driver: Pointer to UART driver * @baud: Current baud rate * @clk_rate_change_nb: Notifier block for clock changes * @quirks: Flags for RXBS support. @@ -204,7 +203,6 @@ struct cdns_uart {struct uart_port *port;struct clk *uartclk;struct clk *pclk; -struct uart_driver *cdns_uart_driver;unsigned int baud;struct notifier_block clk_rate_change_nb;u32 quirks;@@ -1465,7 +1463,6 @@ static struct console cdns_uart_console = {static int cdns_uart_suspend (struct device *device) {struct uart_port *port =dev_get_drvdata (device); -struct cdns_uart *cdns_uart = port->private_data;int may_wake; may_wake =device_may_wakeup (device);@@ -1489,7 +1486,7 @@ static int cdns_uart_suspend(struct device *device)* Call the API provided in serial_core.c file which handles * the suspend. */ -return uart_suspend_port (cdns_uart->cdns_uart_driver, port); +return uart_suspend_port (&cdns_uart_uart_driver, port); }/** @@ -1550,7 +1547,7 @@ static int cdns_uart_resume(struct device *device) uart_port_unlock_irqrestore(port, flags); } -return uart_resume_port (cdns_uart->cdns_uart_driver, port); +return uart_resume_port (&cdns_uart_uart_driver, port); }#endif /* ! CONFIG_PM_SLEEP */ static int __maybe_unused cdns_runtime_suspend (struct device *dev)@@ -1686,8 +1683,6 @@ static int cdns_uart_probe(struct platform_device *pdev) } } - cdns_uart_data->cdns_uart_driver = &cdns_uart_uart_driver; - match =of_match_node (cdns_uart_of_match, pdev->dev.of_node);if (match && match->data) {const struct cdns_platform_data *data = match->data;@@ -1862,7 +1857,7 @@ static int cdns_uart_probe(struct platform_device *pdev)clk_disable_unprepare (cdns_uart_data->pclk); err_out_unregister_driver:if (!instances) -uart_unregister_driver (cdns_uart_data->cdns_uart_driver); +uart_unregister_driver (&cdns_uart_uart_driver);return rc; }@@ -1880,7 +1875,7 @@ static void cdns_uart_remove(struct platform_device *pdev)clk_notifier_unregister (cdns_uart_data->uartclk, &cdns_uart_data->clk_rate_change_nb);#endif -uart_remove_one_port (cdns_uart_data->cdns_uart_driver, port); +uart_remove_one_port (&cdns_uart_uart_driver, port); port->mapbase =0 ;clk_disable_unprepare (cdns_uart_data->uartclk);clk_disable_unprepare (cdns_uart_data->pclk);
drivers/tty/serial/xilinx_uartps.c static void cdns_uart_remove(struct platform_device *pdev) · line 1897
Quoted 8 lines
drivers/tty/serial/xilinx_uartps.c +1
-1@@ -1896,7 +1891,7 @@ static void cdns_uart_remove(struct platform_device *pdev)reset_control_assert (cdns_uart_data->rstc);if (!--instances) -uart_unregister_driver (cdns_uart_data->cdns_uart_driver); +uart_unregister_driver (&cdns_uart_uart_driver); }static struct platform_driver cdns_uart_platform_driver = {
Thanks,
Michal
Jiri Slaby (SUSE)
maintainerPATCH 3/6 serial: drop SERIAL_8250_DEPRECATED_OPTIONS
In reply to Jiri Slaby (SUSE)In 3.7, 8250 was unintentionally renamed to 8250_core. This happened in the commit 835d844d1a28 (8250_pnp: do pnp probe before legacy probe). This made 8250.<xxxx> module options effectively defunct. Instead, 8250_core.<xxxx> worked.
In 3.9, the commit f2b8dfd9e480 (serial: 8250: Keep 8250.<xxxx> module options functional after driver rename) made the original options work again by introducing a hack.
Later in 3.9, the commit 9196d8acd7f9 (TTY: 8250, revert module name change) changed the module name back to 8250 (from 8250_core). Since then, the hack was there to support the transient 8250_core.<xxxx> options. Those were present only in the 3.7..3.9 range.
These transient options were deprecated by 9326b047e4fd (TTY: 8250, deprecated 8250_core.* options) in v3.9 too.
Now, after those 12 years, it is time to get rid of this hack completely.
--- arch/arm/configs/aspeed_g4_defconfig | 1 - arch/arm/configs/aspeed_g5_defconfig | 1 - arch/arm/configs/hisi_defconfig | 1 - arch/arm/configs/lpc18xx_defconfig | 1 - arch/arm/configs/shmobile_defconfig | 1 - arch/mips/configs/bcm47xx_defconfig | 1 - arch/mips/configs/bmips_stb_defconfig | 1 - arch/mips/configs/gcw0_defconfig | 1 - arch/nios2/configs/10m50_defconfig | 1 - arch/parisc/configs/generic-32bit_defconfig | 1 - arch/parisc/configs/generic-64bit_defconfig | 1 - arch/powerpc/configs/44x/akebono_defconfig | 1 - arch/powerpc/configs/microwatt_defconfig | 1 - arch/riscv/configs/nommu_virt_defconfig | 1 - arch/xtensa/configs/audio_kc705_defconfig | 1 - arch/xtensa/configs/generic_kc705_defconfig | 1 - arch/xtensa/configs/nommu_kc705_defconfig | 1 - arch/xtensa/configs/smp_lx200_defconfig | 1 - arch/xtensa/configs/xip_kc705_defconfig | 1 - drivers/tty/serial/8250/8250_platform.c | 27 --------------------- drivers/tty/serial/8250/8250_rsa.c | 24 ------------------ drivers/tty/serial/8250/Kconfig | 17 ------------- 22 files changed, 87 deletions(-)
arch/arm/configs/aspeed_g4_defconfig +0 -1
@@ -117,7 +117,6 @@ CONFIG_KEYBOARD_GPIO_POLLED=y # CONFIG_VT is not set # CONFIG_LEGACY_PTYS is not set CONFIG_SERIAL_8250=y -# CONFIG_SERIAL_8250_DEPRECATED_OPTIONS is not set CONFIG_SERIAL_8250_CONSOLE=y CONFIG_SERIAL_8250_NR_UARTS=6 CONFIG_SERIAL_8250_RUNTIME_UARTS=6
arch/arm/configs/aspeed_g5_defconfig +0 -1
@@ -138,7 +138,6 @@ CONFIG_SERIO_RAW=y # CONFIG_VT is not set # CONFIG_LEGACY_PTYS is not set CONFIG_SERIAL_8250=y -# CONFIG_SERIAL_8250_DEPRECATED_OPTIONS is not set CONFIG_SERIAL_8250_CONSOLE=y CONFIG_SERIAL_8250_NR_UARTS=6 CONFIG_SERIAL_8250_RUNTIME_UARTS=6
arch/arm/configs/hisi_defconfig +0 -1
@@ -35,7 +35,6 @@ CONFIG_NETDEVICES=y CONFIG_HIX5HD2_GMAC=y CONFIG_HIP04_ETH=y CONFIG_SERIAL_8250=y -CONFIG_SERIAL_8250_DEPRECATED_OPTIONS=y CONFIG_SERIAL_8250_CONSOLE=y CONFIG_SERIAL_8250_NR_UARTS=2 CONFIG_SERIAL_8250_RUNTIME_UARTS=2
arch/arm/configs/lpc18xx_defconfig +0 -1
@@ -90,7 +90,6 @@ CONFIG_KEYBOARD_GPIO_POLLED=y # CONFIG_UNIX98_PTYS is not set # CONFIG_LEGACY_PTYS is not set CONFIG_SERIAL_8250=y -# CONFIG_SERIAL_8250_DEPRECATED_OPTIONS is not set CONFIG_SERIAL_8250_CONSOLE=y CONFIG_SERIAL_OF_PLATFORM=y CONFIG_SERIAL_NONSTANDARD=y
arch/arm/configs/shmobile_defconfig +0 -1
@@ -75,7 +75,6 @@ CONFIG_INPUT_DA9063_ONKEY=y CONFIG_INPUT_ADXL34X=y # CONFIG_LEGACY_PTYS is not set CONFIG_SERIAL_8250=y -# CONFIG_SERIAL_8250_DEPRECATED_OPTIONS is not set # CONFIG_SERIAL_8250_16550A_VARIANTS is not set CONFIG_SERIAL_8250_CONSOLE=y # CONFIG_SERIAL_8250_PCI is not set
arch/mips/configs/bcm47xx_defconfig +0 -1
@@ -51,7 +51,6 @@ CONFIG_B43LEGACY=y CONFIG_BRCMSMAC=y CONFIG_ISDN=y CONFIG_SERIAL_8250=y -# CONFIG_SERIAL_8250_DEPRECATED_OPTIONS is not set CONFIG_SERIAL_8250_CONSOLE=y # CONFIG_SERIAL_8250_PCI is not set CONFIG_SERIAL_8250_NR_UARTS=2
arch/mips/configs/bmips_stb_defconfig +0 -1
@@ -119,7 +119,6 @@ CONFIG_INPUT_UINPUT=y CONFIG_VT=y CONFIG_VT_HW_CONSOLE_BINDING=y CONFIG_SERIAL_8250=y -# CONFIG_SERIAL_8250_DEPRECATED_OPTIONS is not set CONFIG_SERIAL_8250_CONSOLE=y CONFIG_SERIAL_OF_PLATFORM=y # CONFIG_HW_RANDOM is not set
arch/mips/configs/gcw0_defconfig +0 -1
@@ -52,7 +52,6 @@ CONFIG_INPUT_UINPUT=y CONFIG_INPUT_PWM_VIBRA=y # CONFIG_SERIO is not set CONFIG_SERIAL_8250=y -# CONFIG_SERIAL_8250_DEPRECATED_OPTIONS is not set CONFIG_SERIAL_8250_CONSOLE=y CONFIG_SERIAL_8250_INGENIC=y CONFIG_HW_RANDOM=y
arch/nios2/configs/10m50_defconfig +0 -1
@@ -51,7 +51,6 @@ CONFIG_MARVELL_PHY=y # CONFIG_SERIO_SERPORT is not set # CONFIG_VT is not set CONFIG_SERIAL_8250=y -# CONFIG_SERIAL_8250_DEPRECATED_OPTIONS is not set CONFIG_SERIAL_8250_CONSOLE=y CONFIG_SERIAL_OF_PLATFORM=y CONFIG_SERIAL_ALTERA_JTAGUART=y
arch/parisc/configs/generic-32bit_defconfig +0 -1
@@ -119,7 +119,6 @@ CONFIG_INPUT_MISC=y CONFIG_INPUT_UINPUT=m CONFIG_LEGACY_PTY_COUNT=64 CONFIG_SERIAL_8250=y -# CONFIG_SERIAL_8250_DEPRECATED_OPTIONS is not set CONFIG_SERIAL_8250_CONSOLE=y CONFIG_SERIAL_8250_NR_UARTS=8 CONFIG_SERIAL_8250_EXTENDED=y
arch/parisc/configs/generic-64bit_defconfig +0 -1
@@ -158,7 +158,6 @@ CONFIG_SERIO_SERPORT=m CONFIG_SERIO_RAW=m # CONFIG_LEGACY_PTYS is not set CONFIG_SERIAL_8250=y -# CONFIG_SERIAL_8250_DEPRECATED_OPTIONS is not set CONFIG_SERIAL_8250_CONSOLE=y CONFIG_SERIAL_8250_NR_UARTS=8 CONFIG_SERIAL_8250_RUNTIME_UARTS=8
arch/powerpc/configs/44x/akebono_defconfig +0 -1
@@ -85,7 +85,6 @@ CONFIG_IBM_EMAC=y # CONFIG_SERIO is not set # CONFIG_VT is not set CONFIG_SERIAL_8250=y -# CONFIG_SERIAL_8250_DEPRECATED_OPTIONS is not set CONFIG_SERIAL_8250_CONSOLE=y CONFIG_SERIAL_8250_EXTENDED=y CONFIG_SERIAL_8250_SHARE_IRQ=y
arch/powerpc/configs/microwatt_defconfig +0 -1
@@ -62,7 +62,6 @@ CONFIG_LITEX_LITEETH=y # CONFIG_VT is not set # CONFIG_LEGACY_PTYS is not set CONFIG_SERIAL_8250=y -# CONFIG_SERIAL_8250_DEPRECATED_OPTIONS is not set CONFIG_SERIAL_8250_CONSOLE=y CONFIG_SERIAL_OF_PLATFORM=y CONFIG_SERIAL_NONSTANDARD=y
arch/riscv/configs/nommu_virt_defconfig +0 -1
@@ -48,7 +48,6 @@ CONFIG_VIRTIO_BLK=y # CONFIG_LEGACY_PTYS is not set # CONFIG_LDISC_AUTOLOAD is not set CONFIG_SERIAL_8250=y -# CONFIG_SERIAL_8250_DEPRECATED_OPTIONS is not set CONFIG_SERIAL_8250_CONSOLE=y CONFIG_SERIAL_8250_NR_UARTS=1 CONFIG_SERIAL_8250_RUNTIME_UARTS=1
arch/xtensa/configs/audio_kc705_defconfig +0 -1
@@ -81,7 +81,6 @@ CONFIG_MARVELL_PHY=y # CONFIG_INPUT_MOUSE is not set # CONFIG_SERIO is not set CONFIG_SERIAL_8250=y -# CONFIG_SERIAL_8250_DEPRECATED_OPTIONS is not set CONFIG_SERIAL_8250_CONSOLE=y CONFIG_SERIAL_OF_PLATFORM=y CONFIG_HW_RANDOM=y
arch/xtensa/configs/generic_kc705_defconfig +0 -1
@@ -79,7 +79,6 @@ CONFIG_MARVELL_PHY=y # CONFIG_INPUT_MOUSE is not set # CONFIG_SERIO is not set CONFIG_SERIAL_8250=y -# CONFIG_SERIAL_8250_DEPRECATED_OPTIONS is not set CONFIG_SERIAL_8250_CONSOLE=y CONFIG_SERIAL_OF_PLATFORM=y CONFIG_HW_RANDOM=y
arch/xtensa/configs/nommu_kc705_defconfig +0 -1
@@ -81,7 +81,6 @@ CONFIG_MARVELL_PHY=y # CONFIG_INPUT_MOUSE is not set # CONFIG_SERIO is not set CONFIG_SERIAL_8250=y -# CONFIG_SERIAL_8250_DEPRECATED_OPTIONS is not set CONFIG_SERIAL_8250_CONSOLE=y CONFIG_SERIAL_OF_PLATFORM=y CONFIG_HW_RANDOM=y
arch/xtensa/configs/smp_lx200_defconfig +0 -1
@@ -83,7 +83,6 @@ CONFIG_MARVELL_PHY=y # CONFIG_INPUT_MOUSE is not set # CONFIG_SERIO is not set CONFIG_SERIAL_8250=y -# CONFIG_SERIAL_8250_DEPRECATED_OPTIONS is not set CONFIG_SERIAL_8250_CONSOLE=y CONFIG_SERIAL_OF_PLATFORM=y CONFIG_HW_RANDOM=y
arch/xtensa/configs/xip_kc705_defconfig +0 -1
@@ -72,7 +72,6 @@ CONFIG_MARVELL_PHY=y # CONFIG_INPUT_MOUSE is not set # CONFIG_SERIO is not set CONFIG_SERIAL_8250=y -# CONFIG_SERIAL_8250_DEPRECATED_OPTIONS is not set CONFIG_SERIAL_8250_CONSOLE=y CONFIG_SERIAL_OF_PLATFORM=y # CONFIG_HWMON is not set
drivers/tty/serial/8250/8250_platform.c +0 -27
@@ -390,30 +390,3 @@ module_param(skip_txen_test, uint, 0644);MODULE_PARM_DESC (skip_txen_test,"Skip checking for the TXEN bug at init time" );MODULE_ALIAS_CHARDEV_MAJOR (TTY_MAJOR ); - -#ifdef CONFIG_SERIAL_8250_DEPRECATED_OPTIONS -#ifndef MODULE -/* -* This module was renamed to 8250_core in 3.7. Keep the old "8250" name -* working as well for the module options so we don't break people. We -* need to keep the names identical and the convenient macros will happily -* refuse to let us do that by failing the build with redefinition errors -* of global variables. So we stick them inside a dummy function to avoid -* those conflicts. The options still get parsed, and the redefined -* MODULE_PARAM_PREFIX lets us keep the "8250." syntax alive. -* -* This is hacky. I'm sorry. -*/ -static void __used s8250_options (void ) -{ -#undef MODULE_PARAM_PREFIX -#define MODULE_PARAM_PREFIX "8250_core." - -module_param_cb (share_irqs, ¶m_ops_uint, &share_irqs,0644 ); -module_param_cb (nr_uarts, ¶m_ops_uint, &nr_uarts,0644 ); -module_param_cb (skip_txen_test, ¶m_ops_uint, &skip_txen_test,0644 ); -} -#else -MODULE_ALIAS ("8250_core" ); -#endif -#endif
drivers/tty/serial/8250/8250_rsa.c +0 -24
@@ -201,27 +201,3 @@ void rsa_reset(struct uart_8250_port *up)serial_out (up,UART_RSA_FRR ,0 ); }EXPORT_SYMBOL_FOR_MODULES (rsa_reset,"8250_base" ); - -#ifdef CONFIG_SERIAL_8250_DEPRECATED_OPTIONS -#ifndef MODULE -/* -* Keep the old "8250" name working as well for the module options so we don't -* break people. We need to keep the names identical and the convenient macros -* will happily refuse to let us do that by failing the build with redefinition -* errors of global variables. So we stick them inside a dummy function to -* avoid those conflicts. The options still get parsed, and the redefined -* MODULE_PARAM_PREFIX lets us keep the "8250." syntax alive. -* -* This is hacky. I'm sorry. -*/ -static void __used rsa8250_options (void ) -{ -#undef MODULE_PARAM_PREFIX -#define MODULE_PARAM_PREFIX "8250_core." - -__module_param_call (MODULE_PARAM_PREFIX , probe_rsa, - ¶m_array_ops, .arr = &__param_arr_probe_rsa, -0444 ,-1 ,0 ); -} -#endif -#endif
drivers/tty/serial/8250/Kconfig +0 -17
@@ -34,23 +34,6 @@ config SERIAL_8250 Most people will say Y or M here, so that they can use serial mice, modems and similar devices connecting to the standard serial ports. -config SERIAL_8250_DEPRECATED_OPTIONS - bool "Support 8250_core.* kernel options (DEPRECATED)" - depends on SERIAL_8250 - default y - help - In 3.7 we renamed 8250 to 8250_core by mistake, so now we have to - accept kernel parameters in both forms like 8250_core.nr_uarts=4 and - 8250.nr_uarts=4. We now renamed the module back to 8250, but if - anybody noticed in 3.7 and changed their userspace we still have to - keep the 8250_core.* options around until they revert the changes - they already did. - - If 8250 is built as a module, this adds 8250_core alias instead. - - If you did not notice yet and/or you have userspace from pre-3.7, it - is safe (and recommended) to say N here. - config SERIAL_8250_PNP bool "8250/16550 PNP device support" if EXPERT depends on SERIAL_8250 && PNP
Signature · 1 line
2.51.1
Jiri Slaby (SUSE)
maintainerPATCH 4/6 serial: 8250: move skip_txen_test to core
In reply to Jiri Slaby (SUSE)8250_core is the only place where skip_txen_test is used. And platform and core end up in 8250.ko, so there is no change in module name (param prefix). Therefore, move skip_txen_test there and make it local.
--- drivers/tty/serial/8250/8250.h | 1 - drivers/tty/serial/8250/8250_core.c | 4 ++++ drivers/tty/serial/8250/8250_platform.c | 5 ----- 3 files changed, 4 insertions(+), 6 deletions(-)
drivers/tty/serial/8250/8250.h +0 -1
@@ -105,7 +105,6 @@ extern unsigned int nr_uarts;#endif extern unsigned int share_irqs; -extern unsigned int skip_txen_test;#define SERIAL8250_PORT_FLAGS (_base, _irq, _flags) \ { \
drivers/tty/serial/8250/8250_core.c +4 -0
@@ -52,6 +52,10 @@ struct irq_info { static DEFINE_HASHTABLE(irq_lists, IRQ_HASH_BITS);static DEFINE_MUTEX (hash_mutex);/* Used to walk the hash */ +static bool skip_txen_test; +module_param (skip_txen_test, bool,0644 ); +MODULE_PARM_DESC (skip_txen_test,"Skip checking for the TXEN bug at init time" ); +/* * This is the serial driver's interrupt routine. *
drivers/tty/serial/8250/8250_platform.c +0 -5
@@ -29,10 +29,8 @@* Configuration: * share_irqs: Whether we pass IRQF_SHARED to request_irq(). * This option is unsafe when used on edge-triggered interrupts. -* skip_txen_test: Force skip of txen test at init time. */ unsigned int share_irqs =SERIAL8250_SHARE_IRQS ; -unsigned int skip_txen_test;unsigned int nr_uarts =CONFIG_SERIAL_8250_RUNTIME_UARTS ;
@@ -386,7 +384,4 @@ MODULE_PARM_DESC(share_irqs, "Share IRQs with other non-8250/16x50 devices (unsamodule_param (nr_uarts, uint,0644 ); MODULE_PARM_DESC(nr_uarts, "Maximum number of UARTs supported. (1-" __MODULE_STRING(CONFIG_SERIAL_8250_NR_UARTS) ")"); -module_param (skip_txen_test, uint,0644 ); -MODULE_PARM_DESC (skip_txen_test,"Skip checking for the TXEN bug at init time" ); -MODULE_ALIAS_CHARDEV_MAJOR (TTY_MAJOR );
Signature · 1 line
2.51.1
Jiri Slaby (SUSE)
maintainerPATCH 5/6 serial: 8250: make share_irqs local to 8250_platform
In reply to Jiri Slaby (SUSE)share_irqs is used solely in 8250_platform. Make it local to that file.
--- drivers/tty/serial/8250/8250.h | 8 -------- drivers/tty/serial/8250/8250_platform.c | 4 ++-- 2 files changed, 2 insertions(+), 10 deletions(-)
drivers/tty/serial/8250/8250.h +0 -8
@@ -98,14 +98,6 @@ struct serial8250_config {extern unsigned int nr_uarts; -#ifdef CONFIG_SERIAL_8250_SHARE_IRQ -#define SERIAL8250_SHARE_IRQS 1 -#else -#define SERIAL8250_SHARE_IRQS 0 -#endif - -extern unsigned int share_irqs; -#define SERIAL8250_PORT_FLAGS (_base, _irq, _flags) \ { \ .iobase = _base, \
drivers/tty/serial/8250/8250_platform.c +2 -2
@@ -30,7 +30,7 @@* share_irqs: Whether we pass IRQF_SHARED to request_irq(). * This option is unsafe when used on edge-triggered interrupts. */ -unsigned int share_irqs =SERIAL8250_SHARE_IRQS ; +static bool share_irqs =IS_ENABLED (CONFIG_SERIAL_8250_SHARE_IRQ );unsigned int nr_uarts =CONFIG_SERIAL_8250_RUNTIME_UARTS ;
@@ -378,7 +378,7 @@ module_exit(serial8250_exit);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("Generic 8250/16x50 serial platform driver" ); -module_param_hw (share_irqs, uint, other,0644 ); +module_param_hw (share_irqs, bool, other,0644 );MODULE_PARM_DESC (share_irqs,"Share IRQs with other non-8250/16x50 devices (unsafe)" );module_param (nr_uarts, uint,0644 );
Signature · 1 line
2.51.1
Jiri Slaby (SUSE)
maintainerPATCH 6/6 serial: 8250_platform: simplify IRQF_SHARED handling
In reply to Jiri Slaby (SUSE)IRQF_SHARED is the only flag handled in __serial8250_isa_init_ports() and serial8250_probe_platform(). There is no need to precompute the flags. Instead, initialize port->irqflags directly in the for loop.
Note the "if (bool)" is cheap and these are not hot paths anyway.
--- drivers/tty/serial/8250/8250_platform.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-)
drivers/tty/serial/8250/8250_platform.c +9 -10
@@ -58,7 +58,7 @@ EXPORT_SYMBOL(serial8250_set_isa_configurator);static void __init __serial8250_isa_init_ports (void ) { -int i, irqflag =0 ; +int i;if (nr_uarts >UART_NR ) nr_uarts =UART_NR ;
@@ -75,9 +75,6 @@ static void __init __serial8250_isa_init_ports(void) univ8250_port_ops = *univ8250_port_base_ops;univ8250_rsa_support (&univ8250_port_ops); -if (share_irqs) - irqflag =IRQF_SHARED ; -for (i =0 ; i <ARRAY_SIZE (old_serial_port) && i < nr_uarts; i++) {struct uart_8250_port *up =serial8250_get_port (i);struct uart_port *port = &up->port;
@@ -92,7 +89,9 @@ static void __init __serial8250_isa_init_ports(void) port->iotype = old_serial_port[i].io_type; port->regshift = old_serial_port[i].iomem_reg_shift; - port->irqflags |= irqflag; +if (share_irqs) + port->irqflags |=IRQF_SHARED ; +if (serial8250_isa_config !=NULL )serial8250_isa_config (i, &up->port, &up->capabilities); }
@@ -155,15 +154,12 @@ static int serial8250_probe_acpi(struct platform_device *pdev)static int serial8250_probe_platform (struct platform_device *dev,struct plat_serial8250_port *p) { -int ret, i, irqflag =0 ; +int ret, i; struct uart_8250_port *uart __free(kfree) = kzalloc(sizeof(*uart), GFP_KERNEL);if (!uart)return -ENOMEM ; -if (share_irqs) - irqflag =IRQF_SHARED ; -for (i =0 ; p && p->flags !=0 ; p++, i++) { uart->port.iobase = p->iobase; uart->port.membase = p->membase;
@@ -191,7 +187,10 @@ static int serial8250_probe_platform(struct platform_device *dev, struct plat_se uart->port.get_mctrl = p->get_mctrl; uart->port.pm = p->pm; uart->port.dev = &dev->dev; - uart->port.irqflags |= irqflag; + +if (share_irqs) + uart->port.irqflags |=IRQF_SHARED ; + ret =serial8250_register_8250_port (uart);if (ret <0 ) { dev_err(&dev->dev, "unable to register port at index %d "
Signature · 1 line
2.51.1