[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACQ1gAiiKywLnTkAV1VkUwT_g-MVeHMGRzP=aTH8fNZ_TnLsXw@mail.gmail.com>
Date: Mon, 26 Sep 2016 13:57:00 +0200
From: Richard Genoud <richard.genoud@...il.com>
To: Uwe Kleine-König
<u.kleine-koenig@...gutronix.de>
Cc: Cyrille Pitchen <cyrille.pitchen@...el.com>,
Alexandre Belloni <alexandre.belloni@...e-electrons.com>,
Nicolas Ferre <nicolas.ferre@...el.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"linux-serial@...r.kernel.org" <linux-serial@...r.kernel.org>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCHv2 1/3] serial: mctrl_gpio: implement mctrl_gpio_use_rtscts
2016-09-22 15:14 GMT+02:00 Uwe Kleine-König <u.kleine-koenig@...gutronix.de>:
> On Mon, Sep 12, 2016 at 11:47:31AM +0200, Richard Genoud wrote:
>> This function returns true if CTS and RTS are used as GPIOs.
>> Some drivers (like atmel_serial) needs to know if the flow control is
>> handled by the controller or by GPIOs.
>>
>> Signed-off-by: Richard Genoud <richard.genoud@...il.com>
>> ---
>> drivers/tty/serial/serial_mctrl_gpio.c | 8 ++++++++
>> drivers/tty/serial/serial_mctrl_gpio.h | 10 ++++++++++
>> 2 files changed, 18 insertions(+)
>>
>> diff --git a/drivers/tty/serial/serial_mctrl_gpio.c b/drivers/tty/serial/serial_mctrl_gpio.c
>> index d2da6aa7f27d..93bed8c99796 100644
>> --- a/drivers/tty/serial/serial_mctrl_gpio.c
>> +++ b/drivers/tty/serial/serial_mctrl_gpio.c
>> @@ -17,6 +17,7 @@
>> #include <linux/err.h>
>> #include <linux/device.h>
>> #include <linux/irq.h>
>> +#include <linux/err.h>
>> #include <linux/gpio/consumer.h>
>> #include <linux/termios.h>
>> #include <linux/serial_core.h>
>> @@ -72,6 +73,13 @@ struct gpio_desc *mctrl_gpio_to_gpiod(struct mctrl_gpios *gpios,
>> }
>> EXPORT_SYMBOL_GPL(mctrl_gpio_to_gpiod);
>>
>> +bool mctrl_gpio_use_rtscts(struct mctrl_gpios *gpios)
>> +{
>> + return !IS_ERR_OR_NULL(mctrl_gpio_to_gpiod(gpios, UART_GPIO_CTS)) &&
>> + !IS_ERR_OR_NULL(mctrl_gpio_to_gpiod(gpios, UART_GPIO_RTS));
>
> mctrl_gpio_to_gpiod cannot return an error pointer. So this is
> (surprise!) a wrong usage of IS_ERR_OR_NULL.
I see, your commit 1d267ea6539f266352f ("serial: mctrl-gpio: simplify
init routine") removed the need of IS_ERR_OR_NULL().
I'll change that.
Thanks !
Richard.
Powered by blists - more mailing lists