lkml.org 
[lkml]   [2016]   [Jan]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v7 2/3] tty: Add software emulated RS485 support for 8250
From
On Tue, Jan 19, 2016 at 10:33 PM, Matwey V. Kornilov <matwey@sai.msu.ru> wrote:
> Implementation of software emulation of RS485 direction handling is based
> on omap_serial driver.
> Before and after transmission RTS is set to the appropriate value.
>
> Note that before calling serial8250_em485_init the caller has to
> ensure that UART will interrupt when shift register empty. Otherwise,
> emultaion cannot be used.
>
> Both serial8250_em485_init and serial8250_em485_destroy are
> idempotent functions.

Seems you have issues with kernel-doc and commentary styles.

Functions in kernel doc are marked as func(), so don't forget parens.

Multi-line comment blocks are going in the style like:

/*
* Text line 1.
* Line 2. New sentence.
*/

You may notice the periods at the end of sentences. There is no need
to keep more heading spaces.

> +
> +static void serial8250_em485_handle_start_tx(unsigned long arg);
> +static void serial8250_em485_handle_stop_tx(unsigned long arg);
> +

And you need forward declarations because of some cyclic dependency?

> +static void serial8250_start_tx(struct uart_port *port)
> +{
> + struct uart_8250_port *up = up_to_u8250p(port);
> +
> + serial8250_rpm_get_tx(up);
> +

> + if (up->em485 &&
> + up->em485->active_timer == &up->em485->start_tx_timer)
> + return;

struct uart_8250_em485 *em485 = up->em485;

if (em485 && em485->active_timer == &em485->start_tx_timer)

?

Same for the rest of code.

> +
> + if (up->em485)
> + start_tx_rs485(port);
> + else
> + __start_tx(port);
> +}

> +struct uart_8250_em485 {
> + struct timer_list start_tx_timer;

…/* "rs485 start tx" timer */

-> kernel-doc

> + struct timer_list stop_tx_timer; /* "rs485 stop tx" timer */
> + struct timer_list *active_timer; /* pointer to active timer */
> +};

--
With Best Regards,
Andy Shevchenko

\
 
 \ /
  Last update: 2016-01-23 16:41    [W:0.014 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site