@@ -189,7 +189,6 @@ MODULE_PARM_DESC(rx_timeout, "Rx timeout, 1-255");
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
*/
@@ -199,7 +198,6 @@ struct cdns_uart {
199
198
struct clk * pclk ;
200
199
struct uart_driver * cdns_uart_driver ;
201
200
unsigned int baud ;
202
- int id ;
203
201
struct notifier_block clk_rate_change_nb ;
204
202
u32 quirks ;
205
203
bool cts_override ;
@@ -1412,7 +1410,7 @@ MODULE_DEVICE_TABLE(of, cdns_uart_of_match);
1412
1410
*/
1413
1411
static int cdns_uart_probe (struct platform_device * pdev )
1414
1412
{
1415
- int rc , irq ;
1413
+ int rc , id , irq ;
1416
1414
struct uart_port * port ;
1417
1415
struct resource * res ;
1418
1416
struct cdns_uart * cdns_uart_data ;
@@ -1438,26 +1436,26 @@ static int cdns_uart_probe(struct platform_device *pdev)
1438
1436
return - ENOMEM ;
1439
1437
1440
1438
/* 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 ;
1444
1442
1445
- if (cdns_uart_data -> id >= CDNS_UART_NR_PORTS ) {
1443
+ if (id >= CDNS_UART_NR_PORTS ) {
1446
1444
dev_err (& pdev -> dev , "Cannot get uart_port structure\n" );
1447
1445
return - ENODEV ;
1448
1446
}
1449
1447
1450
1448
/* There is a need to use unique driver name */
1451
1449
driver_name = devm_kasprintf (& pdev -> dev , GFP_KERNEL , "%s%d" ,
1452
- CDNS_UART_NAME , cdns_uart_data -> id );
1450
+ CDNS_UART_NAME , id );
1453
1451
if (!driver_name )
1454
1452
return - ENOMEM ;
1455
1453
1456
1454
cdns_uart_uart_driver -> owner = THIS_MODULE ;
1457
1455
cdns_uart_uart_driver -> driver_name = driver_name ;
1458
1456
cdns_uart_uart_driver -> dev_name = CDNS_UART_TTY_NAME ;
1459
1457
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 ;
1461
1459
cdns_uart_uart_driver -> nr = 1 ;
1462
1460
1463
1461
#ifdef CONFIG_SERIAL_XILINX_PS_UART_CONSOLE
@@ -1468,7 +1466,7 @@ static int cdns_uart_probe(struct platform_device *pdev)
1468
1466
1469
1467
strncpy (cdns_uart_console -> name , CDNS_UART_TTY_NAME ,
1470
1468
sizeof (cdns_uart_console -> name ));
1471
- cdns_uart_console -> index = cdns_uart_data -> id ;
1469
+ cdns_uart_console -> index = id ;
1472
1470
cdns_uart_console -> write = cdns_uart_console_write ;
1473
1471
cdns_uart_console -> device = uart_console_device ;
1474
1472
cdns_uart_console -> setup = cdns_uart_console_setup ;
@@ -1490,7 +1488,7 @@ static int cdns_uart_probe(struct platform_device *pdev)
1490
1488
* registration because tty_driver structure is not filled.
1491
1489
* name_base is 0 by default.
1492
1490
*/
1493
- cdns_uart_uart_driver -> tty_driver -> name_base = cdns_uart_data -> id ;
1491
+ cdns_uart_uart_driver -> tty_driver -> name_base = id ;
1494
1492
1495
1493
match = of_match_node (cdns_uart_of_match , pdev -> dev .of_node );
1496
1494
if (match && match -> data ) {
0 commit comments