[PATCH 02/10] serial: 8250_dw: support DMA on the OF case

Chen-Yu Tsai wens at csie.org
Sat Jun 21 06:56:04 PDT 2014


On Mon, Jun 16, 2014 at 11:50 AM, Emilio López <emilio at elopez.com.ar> wrote:
> Currently, DMA properties on the DT are ignored when using the 8250_dw
> driver. With this patch, DMA will be used when available.
>
> Signed-off-by: Emilio López <emilio at elopez.com.ar>
> ---
>  drivers/tty/serial/8250/8250_dw.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c
> index ed31135..f75c0bf 100644
> --- a/drivers/tty/serial/8250/8250_dw.c
> +++ b/drivers/tty/serial/8250/8250_dw.c
> @@ -222,6 +222,8 @@ static int dw8250_probe_of(struct uart_port *p,
>                            struct dw8250_data *data)
>  {
>         struct device_node      *np = p->dev->of_node;
> +       struct uart_8250_port   *up = container_of(p, struct uart_8250_port,
> +                                                  port);
>         u32                     val;
>         bool has_ucv = true;
>
> @@ -254,11 +256,14 @@ static int dw8250_probe_of(struct uart_port *p,
>                 }
>         }
>         if (has_ucv)
> -               dw8250_setup_port(container_of(p, struct uart_8250_port, port));
> +               dw8250_setup_port(up);
>
>         if (!of_property_read_u32(np, "reg-shift", &val))
>                 p->regshift = val;
>
> +       if (of_get_property(np, "dmas", NULL))
> +               up->dma = &data->dma;
> +

I suggest adding a comment here. Looking just at the patch,
it's not very intuitive. But otherwise the patch looks good.

ChenYu

>         /* clock got configured through clk api, all done */
>         if (p->uartclk)
>                 return 0;
> --
> 2.0.0



More information about the linux-arm-kernel mailing list