Commit 77748913 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Greg Kroah-Hartman

serial: 8250_platform: Unify comment style

Unify comment style and fix indentation in some cases.
While at it, add that it supports ACPI enumerated non-PNP devices.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20240812154901.1068407-8-andriy.shevchenko@linux.intel.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent cc04428b
...@@ -2,7 +2,9 @@ ...@@ -2,7 +2,9 @@
/* /*
* Universal/legacy platform driver for 8250/16550-type serial ports * Universal/legacy platform driver for 8250/16550-type serial ports
* *
* Supports: ISA-compatible 8250/16550 ports * Supports:
* ISA-compatible 8250/16550 ports
* ACPI 8250/16550 ports
* PNP 8250/16550 ports * PNP 8250/16550 ports
* "serial8250" platform devices * "serial8250" platform devices
*/ */
...@@ -24,9 +26,9 @@ ...@@ -24,9 +26,9 @@
/* /*
* Configuration: * Configuration:
* share_irqs Whether we pass IRQF_SHARED to request_irq(). * share_irqs: Whether we pass IRQF_SHARED to request_irq().
* This option is unsafe when used on edge-triggered interrupts. * This option is unsafe when used on edge-triggered interrupts.
* skip_txen_test Force skip of txen test at init time. * skip_txen_test: Force skip of txen test at init time.
*/ */
unsigned int share_irqs = SERIAL8250_SHARE_IRQS; unsigned int share_irqs = SERIAL8250_SHARE_IRQS;
unsigned int skip_txen_test; unsigned int skip_txen_test;
...@@ -63,9 +65,9 @@ static void __init __serial8250_isa_init_ports(void) ...@@ -63,9 +65,9 @@ static void __init __serial8250_isa_init_ports(void)
nr_uarts = UART_NR; nr_uarts = UART_NR;
/* /*
* Set up initial isa ports based on nr_uart module param, or else * Set up initial ISA ports based on nr_uart module param, or else
* default to CONFIG_SERIAL_8250_RUNTIME_UARTS. Note that we do not * default to CONFIG_SERIAL_8250_RUNTIME_UARTS. Note that we do not
* need to increase nr_uarts when setting up the initial isa ports. * need to increase nr_uarts when setting up the initial ISA ports.
*/ */
for (i = 0; i < nr_uarts; i++) for (i = 0; i < nr_uarts; i++)
serial8250_setup_port(i); serial8250_setup_port(i);
...@@ -132,11 +134,12 @@ static int serial8250_probe_acpi(struct platform_device *pdev) ...@@ -132,11 +134,12 @@ static int serial8250_probe_acpi(struct platform_device *pdev)
return -EINVAL; return -EINVAL;
} }
/* Default clock frequency*/ /* default clock frequency */
uart.port.uartclk = 1843200; uart.port.uartclk = 1843200;
uart.port.type = PORT_16550A; uart.port.type = PORT_16550A;
uart.port.dev = &pdev->dev; uart.port.dev = &pdev->dev;
uart.port.flags |= UPF_SKIP_TEST | UPF_BOOT_AUTOCONF; uart.port.flags |= UPF_SKIP_TEST | UPF_BOOT_AUTOCONF;
ret = uart_read_and_validate_port_properties(&uart.port); ret = uart_read_and_validate_port_properties(&uart.port);
/* no interrupt -> fall back to polling */ /* no interrupt -> fall back to polling */
if (ret == -ENXIO) if (ret == -ENXIO)
...@@ -207,8 +210,8 @@ static int serial8250_probe_platform(struct platform_device *dev, struct plat_se ...@@ -207,8 +210,8 @@ static int serial8250_probe_platform(struct platform_device *dev, struct plat_se
} }
/* /*
* Register a set of serial devices attached to a platform device. The * Register a set of serial devices attached to a platform device.
* list is terminated with a zero flags entry, which means we expect * The list is terminated with a zero flags entry, which means we expect
* all entries to have at least UPF_BOOT_AUTOCONF set. * all entries to have at least UPF_BOOT_AUTOCONF set.
*/ */
static int serial8250_probe(struct platform_device *pdev) static int serial8250_probe(struct platform_device *pdev)
...@@ -293,7 +296,7 @@ static struct platform_driver serial8250_isa_driver = { ...@@ -293,7 +296,7 @@ static struct platform_driver serial8250_isa_driver = {
/* /*
* This "device" covers _all_ ISA 8250-compatible serial devices listed * This "device" covers _all_ ISA 8250-compatible serial devices listed
* in the table in include/asm/serial.h * in the table in include/asm/serial.h.
*/ */
struct platform_device *serial8250_isa_devs; struct platform_device *serial8250_isa_devs;
...@@ -322,8 +325,7 @@ static int __init serial8250_init(void) ...@@ -322,8 +325,7 @@ static int __init serial8250_init(void)
if (ret) if (ret)
goto unreg_uart_drv; goto unreg_uart_drv;
serial8250_isa_devs = platform_device_alloc("serial8250", serial8250_isa_devs = platform_device_alloc("serial8250", PLAT8250_DEV_LEGACY);
PLAT8250_DEV_LEGACY);
if (!serial8250_isa_devs) { if (!serial8250_isa_devs) {
ret = -ENOMEM; ret = -ENOMEM;
goto unreg_pnp; goto unreg_pnp;
...@@ -362,7 +364,7 @@ static void __exit serial8250_exit(void) ...@@ -362,7 +364,7 @@ static void __exit serial8250_exit(void)
/* /*
* This tells serial8250_unregister_port() not to re-register * This tells serial8250_unregister_port() not to re-register
* the ports (thereby making serial8250_isa_driver permanently * the ports (thereby making serial8250_isa_driver permanently
* in use.) * in use).
*/ */
serial8250_isa_devs = NULL; serial8250_isa_devs = NULL;
...@@ -395,12 +397,13 @@ MODULE_ALIAS_CHARDEV_MAJOR(TTY_MAJOR); ...@@ -395,12 +397,13 @@ MODULE_ALIAS_CHARDEV_MAJOR(TTY_MAJOR);
#ifdef CONFIG_SERIAL_8250_DEPRECATED_OPTIONS #ifdef CONFIG_SERIAL_8250_DEPRECATED_OPTIONS
#ifndef MODULE #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 * 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 * 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 * 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 * of global variables. So we stick them inside a dummy function to avoid
* those conflicts. The options still get parsed, and the redefined * those conflicts. The options still get parsed, and the redefined
* MODULE_PARAM_PREFIX lets us keep the "8250." syntax alive. * MODULE_PARAM_PREFIX lets us keep the "8250." syntax alive.
* *
* This is hacky. I'm sorry. * This is hacky. I'm sorry.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment