summaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial/imx.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/tty/serial/imx.c')
-rw-r--r--drivers/tty/serial/imx.c48
1 files changed, 12 insertions, 36 deletions
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 523f296d5747..c5e17569c3ad 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -289,20 +289,6 @@ static inline int imx_uart_is_imx1(struct imx_port *sport)
return sport->devdata->devtype == IMX1_UART;
}
-static inline int imx_uart_is_imx21(struct imx_port *sport)
-{
- return sport->devdata->devtype == IMX21_UART;
-}
-
-static inline int imx_uart_is_imx53(struct imx_port *sport)
-{
- return sport->devdata->devtype == IMX53_UART;
-}
-
-static inline int imx_uart_is_imx6q(struct imx_port *sport)
-{
- return sport->devdata->devtype == IMX6Q_UART;
-}
/*
* Save and restore functions for UCR1, UCR2 and UCR3 registers
*/
@@ -1808,9 +1794,7 @@ imx_uart_set_termios(struct uart_port *port, struct ktermios *termios,
static const char *imx_uart_type(struct uart_port *port)
{
- struct imx_port *sport = (struct imx_port *)port;
-
- return sport->port.type == PORT_IMX ? "IMX" : NULL;
+ return port->type == PORT_IMX ? "IMX" : NULL;
}
/*
@@ -1818,10 +1802,8 @@ static const char *imx_uart_type(struct uart_port *port)
*/
static void imx_uart_config_port(struct uart_port *port, int flags)
{
- struct imx_port *sport = (struct imx_port *)port;
-
if (flags & UART_CONFIG_TYPE)
- sport->port.type = PORT_IMX;
+ port->type = PORT_IMX;
}
/*
@@ -1832,20 +1814,19 @@ static void imx_uart_config_port(struct uart_port *port, int flags)
static int
imx_uart_verify_port(struct uart_port *port, struct serial_struct *ser)
{
- struct imx_port *sport = (struct imx_port *)port;
int ret = 0;
if (ser->type != PORT_UNKNOWN && ser->type != PORT_IMX)
ret = -EINVAL;
- if (sport->port.irq != ser->irq)
+ if (port->irq != ser->irq)
ret = -EINVAL;
if (ser->io_type != UPIO_MEM)
ret = -EINVAL;
- if (sport->port.uartclk / 16 != ser->baud_base)
+ if (port->uartclk / 16 != ser->baud_base)
ret = -EINVAL;
- if (sport->port.mapbase != (unsigned long)ser->iomem_base)
+ if (port->mapbase != (unsigned long)ser->iomem_base)
ret = -EINVAL;
- if (sport->port.iobase != ser->port)
+ if (port->iobase != ser->port)
ret = -EINVAL;
if (ser->hub6 != 0)
ret = -EINVAL;
@@ -2262,21 +2243,16 @@ static int imx_uart_probe(struct platform_device *pdev)
}
sport->port.line = ret;
- if (of_get_property(np, "uart-has-rtscts", NULL) ||
- of_get_property(np, "fsl,uart-has-rtscts", NULL) /* deprecated */)
- sport->have_rtscts = 1;
+ sport->have_rtscts = of_property_read_bool(np, "uart-has-rtscts") ||
+ of_property_read_bool(np, "fsl,uart-has-rtscts"); /* deprecated */
- if (of_get_property(np, "fsl,dte-mode", NULL))
- sport->dte_mode = 1;
+ sport->dte_mode = of_property_read_bool(np, "fsl,dte-mode");
- if (of_get_property(np, "rts-gpios", NULL))
- sport->have_rtsgpio = 1;
+ sport->have_rtsgpio = of_property_present(np, "rts-gpios");
- if (of_get_property(np, "fsl,inverted-tx", NULL))
- sport->inverted_tx = 1;
+ sport->inverted_tx = of_property_read_bool(np, "fsl,inverted-tx");
- if (of_get_property(np, "fsl,inverted-rx", NULL))
- sport->inverted_rx = 1;
+ sport->inverted_rx = of_property_read_bool(np, "fsl,inverted-rx");
if (!of_property_read_u32_array(np, "fsl,dma-info", dma_buf_conf, 2)) {
sport->rx_period_length = dma_buf_conf[0];