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

Re: [Xen-devel] [PATCH v2 4/7] serial: Seperate the PCI device ids and parameters



>>> On 07.03.14 at 20:01, Konrad Rzeszutek Wilk <konrad@xxxxxxxxxx> wrote:
> @@ -96,28 +100,27 @@ struct ns16550_config_mmio {
>  
>  
>  #ifdef HAS_PCI
> +enum ns16550_config_param_nr {

Perhaps better e.g. _kind or _idx rather than _nr? But in the end
you don't use the enum tag anyway, so you could as well leave out
the tag altogether.

> +    param_default = 0,
> +    param_trumanage,
> +    param_oxford,
> +};
>  /*
>   * Create lookup tables for specific MMIO devices..
>   * It is assumed that if the device found is MMIO,
>   * then you have indexed it here. Else, the driver
>   * does nothing.
>   */
> -static struct ns16550_config_mmio __initdata uart_config[] =
> -{
> -    /* Broadcom TruManage device */
> -    {
> -        .vendor_id = 0x14e4,
> -        .dev_id = 0x160a,
> +static struct ns16550_config_param __initdata uart_param[] = {

If you need to touch this anyway, please make both this ...

> +    [param_default] = { }, /* Ignored. */
> +    [param_trumanage] = {
>          .reg_shift = 2,
>          .reg_width = 1,
>          .fifo_size = 16,
>          .lsr_mask = (UART_LSR_THRE | UART_LSR_TEMT),
>          .max_bars = 1,
>      },
> -    /* OXPCIe952 1 Native UART  */
> -    {
> -        .vendor_id = 0x1415,
> -        .dev_id = 0xc138,
> +    [param_oxford] = {
>          .base_baud = 4000000,
>          .uart_offset = 0x200,
>          .first_offset = 0x1000,
> @@ -128,6 +131,21 @@ static struct ns16550_config_mmio __initdata 
> uart_config[] =
>          .max_bars = 1, /* It can do more, but we would need more custom 
> code.*/
>      }
>  };
> +static struct ns16550_config_mmio __initdata uart_config[] =

... and this it "const ... __initconst" now that we have the latter.
(Sorry for not noticing the first time through.)

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.