Re: [PATCH v2] tty: serial: msm_serial: Remove duplicate code in msm_console_setup

From: Pramod Gurav
Date: Mon Jan 12 2015 - 07:46:37 EST


Hi Stephen,

On Friday 09 January 2015 03:16 AM, Stephen Boyd wrote:
> On 01/08/2015 01:15 AM, Pramod Gurav wrote:
>> drivers/tty/serial/msm_serial.c | 15 ---------------
>> 1 file changed, 15 deletions(-)
>>
>> diff --git a/drivers/tty/serial/msm_serial.c b/drivers/tty/serial/msm_serial.c
>> index c88b522..057008d 100644
>> --- a/drivers/tty/serial/msm_serial.c
>> +++ b/drivers/tty/serial/msm_serial.c
>> @@ -932,27 +932,12 @@ static int __init msm_console_setup(struct console *co, char *options)
>> if (unlikely(!port->membase))
>> return -ENXIO;
>>
>> - msm_init_clock(port);
>> -
>
> Hm.. doesn't the console setup happen before the port is opened though?
> I would think that we need to keep this around so that the clock is
> actually enabled before we go and write to hardware registers.
>
>> if (options)
>> uart_parse_options(options, &baud, &parity, &bits, &flow);
>>
>> bits = 8;
>> parity = 'n';
>> flow = 'n';

Checked some of the driver registering console and they mostly have this
but this initialization is done when these variables are declared so
that user provided setting won't be overwritten. I think we too should
follow the same. With these variables initialized when they are declared
user's values will be retained.

>
> I wonder if we should leave this here? Maybe we can rely on the user
> specifying the right values on the command line?
>
>> - msm_write(port, UART_MR2_BITS_PER_CHAR_8 | UART_MR2_STOP_BIT_LEN_ONE,
>> - UART_MR2); /* 8N1 */
>> -
>> - if (baud < 300 || baud > 115200)
>> - baud = 115200;
>> - msm_set_baud_rate(port, baud);
>> -
>> - msm_reset(port);
>> -
>> - if (msm_port->is_uartdm) {
>
> msm_port is unused now. Please remove it in the same patch.
>
--
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/