Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Revert "serial: uartps: Move Port ID to device data structure"

This reverts commit bed25ac0e2b6ab8f9aed2d20bc9c3a2037311800.

As Johan says, this driver needs a lot more work and these changes are
only going in the wrong direction:
https://lkml.kernel.org/r/20190523091839.GC568@localhost

Reported-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Cc: stable <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/eb0ec98fecdca9b79c1a3ac0c30c668b6973b193.1585905873.git.michal.simek@xilinx.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Michal Simek and committed by
Greg Kroah-Hartman
492cc08b 72d68197

+9 -11
+9 -11
drivers/tty/serial/xilinx_uartps.c
··· 189 189 * @pclk: APB clock 190 190 * @cdns_uart_driver: Pointer to UART driver 191 191 * @baud: Current baud rate 192 - * @id: Port ID 193 192 * @clk_rate_change_nb: Notifier block for clock changes 194 193 * @quirks: Flags for RXBS support. 195 194 */ ··· 198 199 struct clk *pclk; 199 200 struct uart_driver *cdns_uart_driver; 200 201 unsigned int baud; 201 - int id; 202 202 struct notifier_block clk_rate_change_nb; 203 203 u32 quirks; 204 204 bool cts_override; ··· 1410 1412 */ 1411 1413 static int cdns_uart_probe(struct platform_device *pdev) 1412 1414 { 1413 - int rc, irq; 1415 + int rc, id, irq; 1414 1416 struct uart_port *port; 1415 1417 struct resource *res; 1416 1418 struct cdns_uart *cdns_uart_data; ··· 1436 1438 return -ENOMEM; 1437 1439 1438 1440 /* Look for a serialN alias */ 1439 - cdns_uart_data->id = of_alias_get_id(pdev->dev.of_node, "serial"); 1440 - if (cdns_uart_data->id < 0) 1441 - cdns_uart_data->id = 0; 1441 + id = of_alias_get_id(pdev->dev.of_node, "serial"); 1442 + if (id < 0) 1443 + id = 0; 1442 1444 1443 - if (cdns_uart_data->id >= CDNS_UART_NR_PORTS) { 1445 + if (id >= CDNS_UART_NR_PORTS) { 1444 1446 dev_err(&pdev->dev, "Cannot get uart_port structure\n"); 1445 1447 return -ENODEV; 1446 1448 } 1447 1449 1448 1450 /* There is a need to use unique driver name */ 1449 1451 driver_name = devm_kasprintf(&pdev->dev, GFP_KERNEL, "%s%d", 1450 - CDNS_UART_NAME, cdns_uart_data->id); 1452 + CDNS_UART_NAME, id); 1451 1453 if (!driver_name) 1452 1454 return -ENOMEM; 1453 1455 ··· 1455 1457 cdns_uart_uart_driver->driver_name = driver_name; 1456 1458 cdns_uart_uart_driver->dev_name = CDNS_UART_TTY_NAME; 1457 1459 cdns_uart_uart_driver->major = CDNS_UART_MAJOR; 1458 - cdns_uart_uart_driver->minor = cdns_uart_data->id; 1460 + cdns_uart_uart_driver->minor = id; 1459 1461 cdns_uart_uart_driver->nr = 1; 1460 1462 1461 1463 #ifdef CONFIG_SERIAL_XILINX_PS_UART_CONSOLE ··· 1466 1468 1467 1469 strncpy(cdns_uart_console->name, CDNS_UART_TTY_NAME, 1468 1470 sizeof(cdns_uart_console->name)); 1469 - cdns_uart_console->index = cdns_uart_data->id; 1471 + cdns_uart_console->index = id; 1470 1472 cdns_uart_console->write = cdns_uart_console_write; 1471 1473 cdns_uart_console->device = uart_console_device; 1472 1474 cdns_uart_console->setup = cdns_uart_console_setup; ··· 1488 1490 * registration because tty_driver structure is not filled. 1489 1491 * name_base is 0 by default. 1490 1492 */ 1491 - cdns_uart_uart_driver->tty_driver->name_base = cdns_uart_data->id; 1493 + cdns_uart_uart_driver->tty_driver->name_base = id; 1492 1494 1493 1495 match = of_match_node(cdns_uart_of_match, pdev->dev.of_node); 1494 1496 if (match && match->data) {