Re: [PATCH 15/19] serial: sh-sci: Extend sci_port_params with more port parameters

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Laurent,

On Wed, Jan 4, 2017 at 12:06 AM, Laurent Pinchart
<laurent.pinchart+renesas@xxxxxxxxxxxxxxxx> wrote:
> The fifo size, overrun register and mask, sampling rate mask and error
> mask all depend on the port type only and don't need to be computed at
> runtime. Add them to the sci_port_parameters structure.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@xxxxxxxxxxxxxxxx>

Reviewed-by: Geert Uytterhoeven <geert+renesas@xxxxxxxxx>

> --- a/drivers/tty/serial/sh-sci.c
> +++ b/drivers/tty/serial/sh-sci.c
> @@ -107,6 +107,12 @@ struct plat_sci_reg {
>
>  struct sci_port_params {
>         const struct plat_sci_reg regs[SCIx_NR_REGS];
> +       unsigned int fifosize;
> +       unsigned int overrun_reg;
> +       unsigned int overrun_mask;
> +       unsigned int sampling_rate_mask;
> +       unsigned int error_mask;
> +       unsigned int error_clear;
>  };
>
>  struct sci_port {


> @@ -2649,29 +2687,10 @@ static int sci_init_single(struct platform_device *dev,
>         sci_port->break_timer.function = sci_break_timer;
>         init_timer(&sci_port->break_timer);
>
> -       /*
> -        * Establish some sensible defaults for the error detection.
> -        */
> -       if (p->type == PORT_SCI) {
> -               sci_port->error_mask = SCI_DEFAULT_ERROR_MASK;
> -               sci_port->error_clear = SCI_ERROR_CLEAR;
> -       } else {
> -               sci_port->error_mask = SCIF_DEFAULT_ERROR_MASK;
> -               sci_port->error_clear = SCIF_ERROR_CLEAR;
> -       }
> -
> -       /*
> -        * Make the error mask inclusive of overrun detection, if
> -        * supported.
> -        */
> -       if (sci_port->overrun_reg == SCxSR) {
> -               sci_port->error_mask |= sci_port->overrun_mask;
> -               sci_port->error_clear &= ~sci_port->overrun_mask;
> -       }
> -
>         port->type              = p->type;
>         port->flags             = UPF_FIXED_PORT | UPF_BOOT_AUTOCONF | p->flags;
>         port->regshift          = p->regshift;
> +       port->fifosize          = sci_port->params->fifosize;

You still need this assignment because you didn't convert a handfull
remaining users of port->fifosize to params->fifosize?

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds



[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux