Commit dce2cbd1 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Greg Kroah-Hartman

serial: 8250_platform: fix uart_8250_port initializer

The first element in uart_8250_port is a structure, so initializing
it to 0 causes a warning on newer compilers:

drivers/tty/serial/8250/8250_platform.c: In function 'serial8250_platform_probe':
drivers/tty/serial/8250/8250_platform.c:111:40: error: excess elements in struct initializer [-Werror]
  111 |         struct uart_8250_port uart = { 0 };

Use the modern empty {} initializer instead that works on all
supported compilers.

Fixes: d9e5a0ce ("serial: 8250_platform: Enable generic 16550A platform devices")
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Reviewed-by: default avatarSunil V L <sunilvl@ventanamicro.com>
Reported-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
Link: https://lore.kernel.org/r/20240807075751.2206508-2-arnd@kernel.orgSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a2a815c7
...@@ -108,7 +108,7 @@ void __init serial8250_isa_init_ports(void) ...@@ -108,7 +108,7 @@ void __init serial8250_isa_init_ports(void)
static int serial8250_platform_probe(struct platform_device *pdev) static int serial8250_platform_probe(struct platform_device *pdev)
{ {
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
struct uart_8250_port uart = { 0 }; struct uart_8250_port uart = { };
struct resource *regs; struct resource *regs;
unsigned char iotype; unsigned char iotype;
int ret, line; int ret, line;
......
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