[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2693913.H5ugjTTm6y@diego>
Date:   Mon, 18 May 2020 10:04:05 +0200
From:   Heiko Stübner <heiko@...ech.de>
To:     Lukas Wunner <lukas@...ner.de>
Cc:     gregkh@...uxfoundation.org, jslaby@...e.com,
        andriy.shevchenko@...ux.intel.com, matwey.kornilov@...il.com,
        giulio.benetti@...ronovasrl.com, linux-serial@...r.kernel.org,
        linux-kernel@...r.kernel.org,
        christoph.muellner@...obroma-systems.com
Subject: Re: [PATCH v3 3/5] serial: 8250: Support separate rs485 rx-enable GPIO
Am Montag, 18. Mai 2020, 06:50:06 CEST schrieb Lukas Wunner:
> On Sun, May 17, 2020 at 11:56:08PM +0200, Heiko Stuebner wrote:
> > @@ -1457,6 +1458,7 @@ void serial8250_em485_stop_tx(struct uart_8250_port *p)
> >  	 * Enable previously disabled RX interrupts.
> >  	 */
> >  	if (!(p->port.rs485.flags & SER_RS485_RX_DURING_TX)) {
> > +		gpiod_set_value(port->rs485_re_gpio, 1);
> >  		serial8250_clear_and_reinit_fifos(p);
> >  
> >  		p->ier |= UART_IER_RLSI | UART_IER_RDI;
> 
> The added line needs to be conditional on if (port->rs485_re_gpio)
> because the gpiod could be NULL and gpiod_set_value() doesn't check
> for that.
Need to look deeper at the other comment below, but gpiod_set_value does
check for NULL ;-)
void gpiod_set_value(struct gpio_desc *desc, int value)
{
	VALIDATE_DESC_VOID(desc);
[...]
which expands to
#define VALIDATE_DESC_VOID(desc) do { \
	int __valid = validate_desc(desc, __func__); \
	if (__valid <= 0) \
		return; \
	} while (0)
which does
 */
static int validate_desc(const struct gpio_desc *desc, const char *func)
{
	if (!desc)
		return 0;
[...]
Heiko
Powered by blists - more mailing lists
 
