Skip to content

Commit 492cc08

Browse files
Michal Simekgregkh
authored andcommitted
Revert "serial: uartps: Move Port ID to device data structure"
This reverts commit bed25ac. 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 <[email protected]> Signed-off-by: Michal Simek <[email protected]> Cc: stable <[email protected]> Link: https://lore.kernel.org/r/eb0ec98fecdca9b79c1a3ac0c30c668b6973b193.1585905873.git.michal.simek@xilinx.com Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 72d6819 commit 492cc08

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

drivers/tty/serial/xilinx_uartps.c

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,6 @@ MODULE_PARM_DESC(rx_timeout, "Rx timeout, 1-255");
189189
* @pclk: APB clock
190190
* @cdns_uart_driver: Pointer to UART driver
191191
* @baud: Current baud rate
192-
* @id: Port ID
193192
* @clk_rate_change_nb: Notifier block for clock changes
194193
* @quirks: Flags for RXBS support.
195194
*/
@@ -199,7 +198,6 @@ struct cdns_uart {
199198
struct clk *pclk;
200199
struct uart_driver *cdns_uart_driver;
201200
unsigned int baud;
202-
int id;
203201
struct notifier_block clk_rate_change_nb;
204202
u32 quirks;
205203
bool cts_override;
@@ -1412,7 +1410,7 @@ MODULE_DEVICE_TABLE(of, cdns_uart_of_match);
14121410
*/
14131411
static int cdns_uart_probe(struct platform_device *pdev)
14141412
{
1415-
int rc, irq;
1413+
int rc, id, irq;
14161414
struct uart_port *port;
14171415
struct resource *res;
14181416
struct cdns_uart *cdns_uart_data;
@@ -1438,26 +1436,26 @@ static int cdns_uart_probe(struct platform_device *pdev)
14381436
return -ENOMEM;
14391437

14401438
/* Look for a serialN alias */
1441-
cdns_uart_data->id = of_alias_get_id(pdev->dev.of_node, "serial");
1442-
if (cdns_uart_data->id < 0)
1443-
cdns_uart_data->id = 0;
1439+
id = of_alias_get_id(pdev->dev.of_node, "serial");
1440+
if (id < 0)
1441+
id = 0;
14441442

1445-
if (cdns_uart_data->id >= CDNS_UART_NR_PORTS) {
1443+
if (id >= CDNS_UART_NR_PORTS) {
14461444
dev_err(&pdev->dev, "Cannot get uart_port structure\n");
14471445
return -ENODEV;
14481446
}
14491447

14501448
/* There is a need to use unique driver name */
14511449
driver_name = devm_kasprintf(&pdev->dev, GFP_KERNEL, "%s%d",
1452-
CDNS_UART_NAME, cdns_uart_data->id);
1450+
CDNS_UART_NAME, id);
14531451
if (!driver_name)
14541452
return -ENOMEM;
14551453

14561454
cdns_uart_uart_driver->owner = THIS_MODULE;
14571455
cdns_uart_uart_driver->driver_name = driver_name;
14581456
cdns_uart_uart_driver->dev_name = CDNS_UART_TTY_NAME;
14591457
cdns_uart_uart_driver->major = CDNS_UART_MAJOR;
1460-
cdns_uart_uart_driver->minor = cdns_uart_data->id;
1458+
cdns_uart_uart_driver->minor = id;
14611459
cdns_uart_uart_driver->nr = 1;
14621460

14631461
#ifdef CONFIG_SERIAL_XILINX_PS_UART_CONSOLE
@@ -1468,7 +1466,7 @@ static int cdns_uart_probe(struct platform_device *pdev)
14681466

14691467
strncpy(cdns_uart_console->name, CDNS_UART_TTY_NAME,
14701468
sizeof(cdns_uart_console->name));
1471-
cdns_uart_console->index = cdns_uart_data->id;
1469+
cdns_uart_console->index = id;
14721470
cdns_uart_console->write = cdns_uart_console_write;
14731471
cdns_uart_console->device = uart_console_device;
14741472
cdns_uart_console->setup = cdns_uart_console_setup;
@@ -1490,7 +1488,7 @@ static int cdns_uart_probe(struct platform_device *pdev)
14901488
* registration because tty_driver structure is not filled.
14911489
* name_base is 0 by default.
14921490
*/
1493-
cdns_uart_uart_driver->tty_driver->name_base = cdns_uart_data->id;
1491+
cdns_uart_uart_driver->tty_driver->name_base = id;
14941492

14951493
match = of_match_node(cdns_uart_of_match, pdev->dev.of_node);
14961494
if (match && match->data) {

0 commit comments

Comments
 (0)