提交 ba77433d 编写于 作者: R Rajendra Nayak 提交者: Tony Lindgren

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: NRajendra Nayak <rnayak@ti.com>
Reviewed-by: NRob Herring <rob.herring@calxeda.com>
Signed-off-by: NTony Lindgren <tony@atomide.com>
上级 7f760f1a
...@@ -115,7 +115,7 @@ static void serial_omap_enable_ms(struct uart_port *port) ...@@ -115,7 +115,7 @@ static void serial_omap_enable_ms(struct uart_port *port)
{ {
struct uart_omap_port *up = (struct uart_omap_port *)port; struct uart_omap_port *up = (struct uart_omap_port *)port;
dev_dbg(up->port.dev, "serial_omap_enable_ms+%d\n", up->pdev->id); dev_dbg(up->port.dev, "serial_omap_enable_ms+%d\n", up->port.line);
pm_runtime_get_sync(&up->pdev->dev); pm_runtime_get_sync(&up->pdev->dev);
up->ier |= UART_IER_MSI; up->ier |= UART_IER_MSI;
...@@ -419,7 +419,7 @@ static unsigned int serial_omap_tx_empty(struct uart_port *port) ...@@ -419,7 +419,7 @@ static unsigned int serial_omap_tx_empty(struct uart_port *port)
unsigned int ret = 0; unsigned int ret = 0;
pm_runtime_get_sync(&up->pdev->dev); pm_runtime_get_sync(&up->pdev->dev);
dev_dbg(up->port.dev, "serial_omap_tx_empty+%d\n", up->pdev->id); dev_dbg(up->port.dev, "serial_omap_tx_empty+%d\n", up->port.line);
spin_lock_irqsave(&up->port.lock, flags); spin_lock_irqsave(&up->port.lock, flags);
ret = serial_in(up, UART_LSR) & UART_LSR_TEMT ? TIOCSER_TEMT : 0; ret = serial_in(up, UART_LSR) & UART_LSR_TEMT ? TIOCSER_TEMT : 0;
spin_unlock_irqrestore(&up->port.lock, flags); spin_unlock_irqrestore(&up->port.lock, flags);
...@@ -437,7 +437,7 @@ static unsigned int serial_omap_get_mctrl(struct uart_port *port) ...@@ -437,7 +437,7 @@ static unsigned int serial_omap_get_mctrl(struct uart_port *port)
status = check_modem_status(up); status = check_modem_status(up);
pm_runtime_put(&up->pdev->dev); pm_runtime_put(&up->pdev->dev);
dev_dbg(up->port.dev, "serial_omap_get_mctrl+%d\n", up->pdev->id); dev_dbg(up->port.dev, "serial_omap_get_mctrl+%d\n", up->port.line);
if (status & UART_MSR_DCD) if (status & UART_MSR_DCD)
ret |= TIOCM_CAR; ret |= TIOCM_CAR;
...@@ -455,7 +455,7 @@ static void serial_omap_set_mctrl(struct uart_port *port, unsigned int mctrl) ...@@ -455,7 +455,7 @@ static void serial_omap_set_mctrl(struct uart_port *port, unsigned int mctrl)
struct uart_omap_port *up = (struct uart_omap_port *)port; struct uart_omap_port *up = (struct uart_omap_port *)port;
unsigned char mcr = 0; unsigned char mcr = 0;
dev_dbg(up->port.dev, "serial_omap_set_mctrl+%d\n", up->pdev->id); dev_dbg(up->port.dev, "serial_omap_set_mctrl+%d\n", up->port.line);
if (mctrl & TIOCM_RTS) if (mctrl & TIOCM_RTS)
mcr |= UART_MCR_RTS; mcr |= UART_MCR_RTS;
if (mctrl & TIOCM_DTR) if (mctrl & TIOCM_DTR)
...@@ -479,7 +479,7 @@ static void serial_omap_break_ctl(struct uart_port *port, int break_state) ...@@ -479,7 +479,7 @@ static void serial_omap_break_ctl(struct uart_port *port, int break_state)
struct uart_omap_port *up = (struct uart_omap_port *)port; struct uart_omap_port *up = (struct uart_omap_port *)port;
unsigned long flags = 0; unsigned long flags = 0;
dev_dbg(up->port.dev, "serial_omap_break_ctl+%d\n", up->pdev->id); dev_dbg(up->port.dev, "serial_omap_break_ctl+%d\n", up->port.line);
pm_runtime_get_sync(&up->pdev->dev); pm_runtime_get_sync(&up->pdev->dev);
spin_lock_irqsave(&up->port.lock, flags); spin_lock_irqsave(&up->port.lock, flags);
if (break_state == -1) if (break_state == -1)
...@@ -505,7 +505,7 @@ static int serial_omap_startup(struct uart_port *port) ...@@ -505,7 +505,7 @@ static int serial_omap_startup(struct uart_port *port)
if (retval) if (retval)
return retval; return retval;
dev_dbg(up->port.dev, "serial_omap_startup+%d\n", up->pdev->id); dev_dbg(up->port.dev, "serial_omap_startup+%d\n", up->port.line);
pm_runtime_get_sync(&up->pdev->dev); pm_runtime_get_sync(&up->pdev->dev);
/* /*
...@@ -546,7 +546,7 @@ static int serial_omap_startup(struct uart_port *port) ...@@ -546,7 +546,7 @@ static int serial_omap_startup(struct uart_port *port)
0); 0);
init_timer(&(up->uart_dma.rx_timer)); init_timer(&(up->uart_dma.rx_timer));
up->uart_dma.rx_timer.function = serial_omap_rxdma_poll; up->uart_dma.rx_timer.function = serial_omap_rxdma_poll;
up->uart_dma.rx_timer.data = up->pdev->id; up->uart_dma.rx_timer.data = up->port.line;
/* Currently the buffer size is 4KB. Can increase it */ /* Currently the buffer size is 4KB. Can increase it */
up->uart_dma.rx_buf = dma_alloc_coherent(NULL, up->uart_dma.rx_buf = dma_alloc_coherent(NULL,
up->uart_dma.rx_buf_size, up->uart_dma.rx_buf_size,
...@@ -574,7 +574,7 @@ static void serial_omap_shutdown(struct uart_port *port) ...@@ -574,7 +574,7 @@ static void serial_omap_shutdown(struct uart_port *port)
struct uart_omap_port *up = (struct uart_omap_port *)port; struct uart_omap_port *up = (struct uart_omap_port *)port;
unsigned long flags = 0; unsigned long flags = 0;
dev_dbg(up->port.dev, "serial_omap_shutdown+%d\n", up->pdev->id); dev_dbg(up->port.dev, "serial_omap_shutdown+%d\n", up->port.line);
pm_runtime_get_sync(&up->pdev->dev); pm_runtime_get_sync(&up->pdev->dev);
/* /*
...@@ -884,7 +884,7 @@ serial_omap_set_termios(struct uart_port *port, struct ktermios *termios, ...@@ -884,7 +884,7 @@ serial_omap_set_termios(struct uart_port *port, struct ktermios *termios,
spin_unlock_irqrestore(&up->port.lock, flags); spin_unlock_irqrestore(&up->port.lock, flags);
pm_runtime_put(&up->pdev->dev); pm_runtime_put(&up->pdev->dev);
dev_dbg(up->port.dev, "serial_omap_set_termios+%d\n", up->pdev->id); dev_dbg(up->port.dev, "serial_omap_set_termios+%d\n", up->port.line);
} }
static void static void
...@@ -894,7 +894,7 @@ serial_omap_pm(struct uart_port *port, unsigned int state, ...@@ -894,7 +894,7 @@ serial_omap_pm(struct uart_port *port, unsigned int state,
struct uart_omap_port *up = (struct uart_omap_port *)port; struct uart_omap_port *up = (struct uart_omap_port *)port;
unsigned char efr; unsigned char efr;
dev_dbg(up->port.dev, "serial_omap_pm+%d\n", up->pdev->id); dev_dbg(up->port.dev, "serial_omap_pm+%d\n", up->port.line);
pm_runtime_get_sync(&up->pdev->dev); pm_runtime_get_sync(&up->pdev->dev);
serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B); 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,7 +933,7 @@ static void serial_omap_config_port(struct uart_port *port, int flags)
struct uart_omap_port *up = (struct uart_omap_port *)port; struct uart_omap_port *up = (struct uart_omap_port *)port;
dev_dbg(up->port.dev, "serial_omap_config_port+%d\n", dev_dbg(up->port.dev, "serial_omap_config_port+%d\n",
up->pdev->id); up->port.line);
up->port.type = PORT_OMAP; up->port.type = PORT_OMAP;
} }
...@@ -950,7 +950,7 @@ serial_omap_type(struct uart_port *port) ...@@ -950,7 +950,7 @@ serial_omap_type(struct uart_port *port)
{ {
struct uart_omap_port *up = (struct uart_omap_port *)port; struct uart_omap_port *up = (struct uart_omap_port *)port;
dev_dbg(up->port.dev, "serial_omap_type+%d\n", up->pdev->id); dev_dbg(up->port.dev, "serial_omap_type+%d\n", up->port.line);
return up->name; return up->name;
} }
...@@ -1111,7 +1111,7 @@ static struct console serial_omap_console = { ...@@ -1111,7 +1111,7 @@ static struct console serial_omap_console = {
static void serial_omap_add_console_port(struct uart_omap_port *up) static void serial_omap_add_console_port(struct uart_omap_port *up)
{ {
serial_omap_console_ports[up->pdev->id] = up; serial_omap_console_ports[up->port.line] = up;
} }
#define OMAP_CONSOLE (&serial_omap_console) #define OMAP_CONSOLE (&serial_omap_console)
...@@ -1365,7 +1365,6 @@ static int serial_omap_probe(struct platform_device *pdev) ...@@ -1365,7 +1365,6 @@ static int serial_omap_probe(struct platform_device *pdev)
ret = -ENOMEM; ret = -ENOMEM;
goto do_release_region; goto do_release_region;
} }
sprintf(up->name, "OMAP UART%d", pdev->id);
up->pdev = pdev; up->pdev = pdev;
up->port.dev = &pdev->dev; up->port.dev = &pdev->dev;
up->port.type = PORT_OMAP; up->port.type = PORT_OMAP;
...@@ -1376,6 +1375,7 @@ static int serial_omap_probe(struct platform_device *pdev) ...@@ -1376,6 +1375,7 @@ static int serial_omap_probe(struct platform_device *pdev)
up->port.fifosize = 64; up->port.fifosize = 64;
up->port.ops = &serial_omap_pops; up->port.ops = &serial_omap_pops;
up->port.line = pdev->id; up->port.line = pdev->id;
sprintf(up->name, "OMAP UART%d", up->port.line);
up->port.mapbase = mem->start; up->port.mapbase = mem->start;
up->port.membase = ioremap(mem->start, resource_size(mem)); up->port.membase = ioremap(mem->start, resource_size(mem));
...@@ -1418,7 +1418,7 @@ static int serial_omap_probe(struct platform_device *pdev) ...@@ -1418,7 +1418,7 @@ static int serial_omap_probe(struct platform_device *pdev)
pm_runtime_enable(&pdev->dev); pm_runtime_enable(&pdev->dev);
pm_runtime_get_sync(&pdev->dev); pm_runtime_get_sync(&pdev->dev);
ui[pdev->id] = up; ui[up->port.line] = up;
serial_omap_add_console_port(up); serial_omap_add_console_port(up);
ret = uart_add_one_port(&serial_omap_reg, &up->port); ret = uart_add_one_port(&serial_omap_reg, &up->port);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册