Re: [PATCH 2/4] pch_uart: Add Fish River Island II uart clock quirks

From: Darren Hart
Date: Wed Feb 22 2012 - 04:46:40 EST




On 02/22/2012 12:52 AM, Alan Cox wrote:
>> + /* Setup UART clock, checking for board specific clocks. */
>> + uartclk = DEFAULT_UARTCLK;
>> +
>> + board_name = dmi_get_system_info(DMI_BOARD_NAME);
>> + if (board_name && strstr(board_name, "CM-iTC"))
>> + uartclk = CMITC_UARTCLK;
>> +
>> + board_name = dmi_get_system_info(DMI_PRODUCT_NAME);
>> + if (board_name && strstr(board_name, "Fish River Island II"))
>> + uartclk = FRI2_UARTCLK;
>> +
>> + port->uartclk = uartclk;
>
> This is confusing, you load product name into a variable called
> board_name ?? perhaps "name" would be clearer ?

OK, done.

>
>>
>> if (options)
>> uart_parse_options(options, &baud, &parity, &bits, &flow);
>> @@ -1566,12 +1580,16 @@ static struct eg20t_port *pch_uart_init_port(struct pci_dev *pdev,
>> if (!rxbuf)
>> goto init_port_free_txbuf;
>>
>> + /* Setup UART clock, checking for board specific clocks. */
>> uartclk = DEFAULT_UARTCLK;
>>
>> - /* quirk for CM-iTC board */
>> board_name = dmi_get_system_info(DMI_BOARD_NAME);
>> if (board_name && strstr(board_name, "CM-iTC"))
>> - uartclk = 192000000; /* 192.0MHz */
>> + uartclk = CMITC_UARTCLK;
>> +
>> + board_name = dmi_get_system_info(DMI_PRODUCT_NAME);
>> + if (board_name && strstr(board_name, "Fish River Island II"))
>> + uartclk = FRI2_UARTCLK;
>
> And we have two locations so this is going to get missed on updates. Can
> we have one function for this please ?

Right, bad dvhart. Done. That cleans things up nicely. I'll resend as V2
after considering your 0/4 response....

--
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/