aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorRajendra Nayak <rnayak@ti.com>2011-12-14 06:55:43 -0500
committerTony Lindgren <tony@atomide.com>2011-12-16 17:07:45 -0500
commitba77433da6e48062825169ae41d8efe7c183c3db (patch)
treedf1b9a33583512ca744f956514c54ddbbce34a85 /drivers
parent7f760f1abcd1a36b52776c90f6a601dd90f06ecb (diff)
omap-serial: Get rid of all pdev->id usage
With Device tree, pdev->id would no longer be Valid. Hence get rid of all instances of its usage in the driver. Device tree support for the driver is added in subsequent patches. Signed-off-by: Rajendra Nayak <rnayak@ti.com> Reviewed-by: Rob Herring <rob.herring@calxeda.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/tty/serial/omap-serial.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
index 7b0303d34021..1baf24b96469 100644
--- a/drivers/tty/serial/omap-serial.c
+++ b/drivers/tty/serial/omap-serial.c
@@ -115,7 +115,7 @@ static void serial_omap_enable_ms(struct uart_port *port)
115{ 115{
116 struct uart_omap_port *up = (struct uart_omap_port *)port; 116 struct uart_omap_port *up = (struct uart_omap_port *)port;
117 117
118 dev_dbg(up->port.dev, "serial_omap_enable_ms+%d\n", up->pdev->id); 118 dev_dbg(up->port.dev, "serial_omap_enable_ms+%d\n", up->port.line);
119 119
120 pm_runtime_get_sync(&up->pdev->dev); 120 pm_runtime_get_sync(&up->pdev->dev);
121 up->ier |= UART_IER_MSI; 121 up->ier |= UART_IER_MSI;
@@ -419,7 +419,7 @@ static unsigned int serial_omap_tx_empty(struct uart_port *port)
419 unsigned int ret = 0; 419 unsigned int ret = 0;
420 420
421 pm_runtime_get_sync(&up->pdev->dev); 421 pm_runtime_get_sync(&up->pdev->dev);
422 dev_dbg(up->port.dev, "serial_omap_tx_empty+%d\n", up->pdev->id); 422 dev_dbg(up->port.dev, "serial_omap_tx_empty+%d\n", up->port.line);
423 spin_lock_irqsave(&up->port.lock, flags); 423 spin_lock_irqsave(&up->port.lock, flags);
424 ret = serial_in(up, UART_LSR) & UART_LSR_TEMT ? TIOCSER_TEMT : 0; 424 ret = serial_in(up, UART_LSR) & UART_LSR_TEMT ? TIOCSER_TEMT : 0;
425 spin_unlock_irqrestore(&up->port.lock, flags); 425 spin_unlock_irqrestore(&up->port.lock, flags);
@@ -437,7 +437,7 @@ static unsigned int serial_omap_get_mctrl(struct uart_port *port)
437 status = check_modem_status(up); 437 status = check_modem_status(up);
438 pm_runtime_put(&up->pdev->dev); 438 pm_runtime_put(&up->pdev->dev);
439 439
440 dev_dbg(up->port.dev, "serial_omap_get_mctrl+%d\n", up->pdev->id); 440 dev_dbg(up->port.dev, "serial_omap_get_mctrl+%d\n", up->port.line);
441 441
442 if (status & UART_MSR_DCD) 442 if (status & UART_MSR_DCD)
443 ret |= TIOCM_CAR; 443 ret |= TIOCM_CAR;
@@ -455,7 +455,7 @@ static void serial_omap_set_mctrl(struct uart_port *port, unsigned int mctrl)
455 struct uart_omap_port *up = (struct uart_omap_port *)port; 455 struct uart_omap_port *up = (struct uart_omap_port *)port;
456 unsigned char mcr = 0; 456 unsigned char mcr = 0;
457 457
458 dev_dbg(up->port.dev, "serial_omap_set_mctrl+%d\n", up->pdev->id); 458 dev_dbg(up->port.dev, "serial_omap_set_mctrl+%d\n", up->port.line);
459 if (mctrl & TIOCM_RTS) 459 if (mctrl & TIOCM_RTS)
460 mcr |= UART_MCR_RTS; 460 mcr |= UART_MCR_RTS;
461 if (mctrl & TIOCM_DTR) 461 if (mctrl & TIOCM_DTR)
@@ -479,7 +479,7 @@ static void serial_omap_break_ctl(struct uart_port *port, int break_state)
479 struct uart_omap_port *up = (struct uart_omap_port *)port; 479 struct uart_omap_port *up = (struct uart_omap_port *)port;
480 unsigned long flags = 0; 480 unsigned long flags = 0;
481 481
482 dev_dbg(up->port.dev, "serial_omap_break_ctl+%d\n", up->pdev->id); 482 dev_dbg(up->port.dev, "serial_omap_break_ctl+%d\n", up->port.line);
483 pm_runtime_get_sync(&up->pdev->dev); 483 pm_runtime_get_sync(&up->pdev->dev);
484 spin_lock_irqsave(&up->port.lock, flags); 484 spin_lock_irqsave(&up->port.lock, flags);
485 if (break_state == -1) 485 if (break_state == -1)
@@ -505,7 +505,7 @@ static int serial_omap_startup(struct uart_port *port)
505 if (retval) 505 if (retval)
506 return retval; 506 return retval;
507 507
508 dev_dbg(up->port.dev, "serial_omap_startup+%d\n", up->pdev->id); 508 dev_dbg(up->port.dev, "serial_omap_startup+%d\n", up->port.line);
509 509
510 pm_runtime_get_sync(&up->pdev->dev); 510 pm_runtime_get_sync(&up->pdev->dev);
511 /* 511 /*
@@ -546,7 +546,7 @@ static int serial_omap_startup(struct uart_port *port)
546 0); 546 0);
547 init_timer(&(up->uart_dma.rx_timer)); 547 init_timer(&(up->uart_dma.rx_timer));
548 up->uart_dma.rx_timer.function = serial_omap_rxdma_poll; 548 up->uart_dma.rx_timer.function = serial_omap_rxdma_poll;
549 up->uart_dma.rx_timer.data = up->pdev->id; 549 up->uart_dma.rx_timer.data = up->port.line;
550 /* Currently the buffer size is 4KB. Can increase it */ 550 /* Currently the buffer size is 4KB. Can increase it */
551 up->uart_dma.rx_buf = dma_alloc_coherent(NULL, 551 up->uart_dma.rx_buf = dma_alloc_coherent(NULL,
552 up->uart_dma.rx_buf_size, 552 up->uart_dma.rx_buf_size,
@@ -574,7 +574,7 @@ static void serial_omap_shutdown(struct uart_port *port)
574 struct uart_omap_port *up = (struct uart_omap_port *)port; 574 struct uart_omap_port *up = (struct uart_omap_port *)port;
575 unsigned long flags = 0; 575 unsigned long flags = 0;
576 576
577 dev_dbg(up->port.dev, "serial_omap_shutdown+%d\n", up->pdev->id); 577 dev_dbg(up->port.dev, "serial_omap_shutdown+%d\n", up->port.line);
578 578
579 pm_runtime_get_sync(&up->pdev->dev); 579 pm_runtime_get_sync(&up->pdev->dev);
580 /* 580 /*
@@ -884,7 +884,7 @@ serial_omap_set_termios(struct uart_port *port, struct ktermios *termios,
884 884
885 spin_unlock_irqrestore(&up->port.lock, flags); 885 spin_unlock_irqrestore(&up->port.lock, flags);
886 pm_runtime_put(&up->pdev->dev); 886 pm_runtime_put(&up->pdev->dev);
887 dev_dbg(up->port.dev, "serial_omap_set_termios+%d\n", up->pdev->id); 887 dev_dbg(up->port.dev, "serial_omap_set_termios+%d\n", up->port.line);
888} 888}
889 889
890static void 890static void
@@ -894,7 +894,7 @@ serial_omap_pm(struct uart_port *port, unsigned int state,
894 struct uart_omap_port *up = (struct uart_omap_port *)port; 894 struct uart_omap_port *up = (struct uart_omap_port *)port;
895 unsigned char efr; 895 unsigned char efr;
896 896
897 dev_dbg(up->port.dev, "serial_omap_pm+%d\n", up->pdev->id); 897 dev_dbg(up->port.dev, "serial_omap_pm+%d\n", up->port.line);
898 898
899 pm_runtime_get_sync(&up->pdev->dev); 899 pm_runtime_get_sync(&up->pdev->dev);
900 serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B); 900 serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B);
@@ -933,7 +933,7 @@ static void serial_omap_config_port(struct uart_port *port, int flags)
933 struct uart_omap_port *up = (struct uart_omap_port *)port; 933 struct uart_omap_port *up = (struct uart_omap_port *)port;
934 934
935 dev_dbg(up->port.dev, "serial_omap_config_port+%d\n", 935 dev_dbg(up->port.dev, "serial_omap_config_port+%d\n",
936 up->pdev->id); 936 up->port.line);
937 up->port.type = PORT_OMAP; 937 up->port.type = PORT_OMAP;
938} 938}
939 939
@@ -950,7 +950,7 @@ serial_omap_type(struct uart_port *port)
950{ 950{
951 struct uart_omap_port *up = (struct uart_omap_port *)port; 951 struct uart_omap_port *up = (struct uart_omap_port *)port;
952 952
953 dev_dbg(up->port.dev, "serial_omap_type+%d\n", up->pdev->id); 953 dev_dbg(up->port.dev, "serial_omap_type+%d\n", up->port.line);
954 return up->name; 954 return up->name;
955} 955}
956 956
@@ -1111,7 +1111,7 @@ static struct console serial_omap_console = {
1111 1111
1112static void serial_omap_add_console_port(struct uart_omap_port *up) 1112static void serial_omap_add_console_port(struct uart_omap_port *up)
1113{ 1113{
1114 serial_omap_console_ports[up->pdev->id] = up; 1114 serial_omap_console_ports[up->port.line] = up;
1115} 1115}
1116 1116
1117#define OMAP_CONSOLE (&serial_omap_console) 1117#define OMAP_CONSOLE (&serial_omap_console)
@@ -1365,7 +1365,6 @@ static int serial_omap_probe(struct platform_device *pdev)
1365 ret = -ENOMEM; 1365 ret = -ENOMEM;
1366 goto do_release_region; 1366 goto do_release_region;
1367 } 1367 }
1368 sprintf(up->name, "OMAP UART%d", pdev->id);
1369 up->pdev = pdev; 1368 up->pdev = pdev;
1370 up->port.dev = &pdev->dev; 1369 up->port.dev = &pdev->dev;
1371 up->port.type = PORT_OMAP; 1370 up->port.type = PORT_OMAP;
@@ -1376,6 +1375,7 @@ static int serial_omap_probe(struct platform_device *pdev)
1376 up->port.fifosize = 64; 1375 up->port.fifosize = 64;
1377 up->port.ops = &serial_omap_pops; 1376 up->port.ops = &serial_omap_pops;
1378 up->port.line = pdev->id; 1377 up->port.line = pdev->id;
1378 sprintf(up->name, "OMAP UART%d", up->port.line);
1379 1379
1380 up->port.mapbase = mem->start; 1380 up->port.mapbase = mem->start;
1381 up->port.membase = ioremap(mem->start, resource_size(mem)); 1381 up->port.membase = ioremap(mem->start, resource_size(mem));
@@ -1418,7 +1418,7 @@ static int serial_omap_probe(struct platform_device *pdev)
1418 pm_runtime_enable(&pdev->dev); 1418 pm_runtime_enable(&pdev->dev);
1419 pm_runtime_get_sync(&pdev->dev); 1419 pm_runtime_get_sync(&pdev->dev);
1420 1420
1421 ui[pdev->id] = up; 1421 ui[up->port.line] = up;
1422 serial_omap_add_console_port(up); 1422 serial_omap_add_console_port(up);
1423 1423
1424 ret = uart_add_one_port(&serial_omap_reg, &up->port); 1424 ret = uart_add_one_port(&serial_omap_reg, &up->port);