Skip to content

Commit 7774891

Browse files
andy-shevgregkh
authored andcommitted
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: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20240812154901.1068407-8-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent cc04428 commit 7774891

1 file changed

Lines changed: 19 additions & 16 deletions

File tree

drivers/tty/serial/8250/8250_platform.c

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
/*
33
* Universal/legacy platform driver for 8250/16550-type serial ports
44
*
5-
* Supports: ISA-compatible 8250/16550 ports
5+
* Supports:
6+
* ISA-compatible 8250/16550 ports
7+
* ACPI 8250/16550 ports
68
* PNP 8250/16550 ports
79
* "serial8250" platform devices
810
*/
@@ -24,9 +26,9 @@
2426

2527
/*
2628
* Configuration:
27-
* share_irqs Whether we pass IRQF_SHARED to request_irq().
29+
* share_irqs: Whether we pass IRQF_SHARED to request_irq().
2830
* This option is unsafe when used on edge-triggered interrupts.
29-
* skip_txen_test Force skip of txen test at init time.
31+
* skip_txen_test: Force skip of txen test at init time.
3032
*/
3133
unsigned int share_irqs = SERIAL8250_SHARE_IRQS;
3234
unsigned int skip_txen_test;
@@ -63,9 +65,9 @@ static void __init __serial8250_isa_init_ports(void)
6365
nr_uarts = UART_NR;
6466

6567
/*
66-
* Set up initial isa ports based on nr_uart module param, or else
68+
* Set up initial ISA ports based on nr_uart module param, or else
6769
* default to CONFIG_SERIAL_8250_RUNTIME_UARTS. Note that we do not
68-
* need to increase nr_uarts when setting up the initial isa ports.
70+
* need to increase nr_uarts when setting up the initial ISA ports.
6971
*/
7072
for (i = 0; i < nr_uarts; i++)
7173
serial8250_setup_port(i);
@@ -132,11 +134,12 @@ static int serial8250_probe_acpi(struct platform_device *pdev)
132134
return -EINVAL;
133135
}
134136

135-
/* Default clock frequency*/
137+
/* default clock frequency */
136138
uart.port.uartclk = 1843200;
137139
uart.port.type = PORT_16550A;
138140
uart.port.dev = &pdev->dev;
139141
uart.port.flags |= UPF_SKIP_TEST | UPF_BOOT_AUTOCONF;
142+
140143
ret = uart_read_and_validate_port_properties(&uart.port);
141144
/* no interrupt -> fall back to polling */
142145
if (ret == -ENXIO)
@@ -207,8 +210,8 @@ static int serial8250_probe_platform(struct platform_device *dev, struct plat_se
207210
}
208211

209212
/*
210-
* Register a set of serial devices attached to a platform device. The
211-
* list is terminated with a zero flags entry, which means we expect
213+
* Register a set of serial devices attached to a platform device.
214+
* The list is terminated with a zero flags entry, which means we expect
212215
* all entries to have at least UPF_BOOT_AUTOCONF set.
213216
*/
214217
static int serial8250_probe(struct platform_device *pdev)
@@ -293,7 +296,7 @@ static struct platform_driver serial8250_isa_driver = {
293296

294297
/*
295298
* This "device" covers _all_ ISA 8250-compatible serial devices listed
296-
* in the table in include/asm/serial.h
299+
* in the table in include/asm/serial.h.
297300
*/
298301
struct platform_device *serial8250_isa_devs;
299302

@@ -322,8 +325,7 @@ static int __init serial8250_init(void)
322325
if (ret)
323326
goto unreg_uart_drv;
324327

325-
serial8250_isa_devs = platform_device_alloc("serial8250",
326-
PLAT8250_DEV_LEGACY);
328+
serial8250_isa_devs = platform_device_alloc("serial8250", PLAT8250_DEV_LEGACY);
327329
if (!serial8250_isa_devs) {
328330
ret = -ENOMEM;
329331
goto unreg_pnp;
@@ -362,7 +364,7 @@ static void __exit serial8250_exit(void)
362364
/*
363365
* This tells serial8250_unregister_port() not to re-register
364366
* the ports (thereby making serial8250_isa_driver permanently
365-
* in use.)
367+
* in use).
366368
*/
367369
serial8250_isa_devs = NULL;
368370

@@ -395,12 +397,13 @@ MODULE_ALIAS_CHARDEV_MAJOR(TTY_MAJOR);
395397

396398
#ifdef CONFIG_SERIAL_8250_DEPRECATED_OPTIONS
397399
#ifndef MODULE
398-
/* This module was renamed to 8250_core in 3.7. Keep the old "8250" name
399-
* working as well for the module options so we don't break people. We
400+
/*
401+
* This module was renamed to 8250_core in 3.7. Keep the old "8250" name
402+
* working as well for the module options so we don't break people. We
400403
* need to keep the names identical and the convenient macros will happily
401404
* refuse to let us do that by failing the build with redefinition errors
402-
* of global variables. So we stick them inside a dummy function to avoid
403-
* those conflicts. The options still get parsed, and the redefined
405+
* of global variables. So we stick them inside a dummy function to avoid
406+
* those conflicts. The options still get parsed, and the redefined
404407
* MODULE_PARAM_PREFIX lets us keep the "8250." syntax alive.
405408
*
406409
* This is hacky. I'm sorry.

0 commit comments

Comments
 (0)