diff options
author | YueHaibing <yuehaibing@huawei.com> | 2020-10-31 04:05:30 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-11-06 17:12:05 +0100 |
commit | cbd90e746148339ddbf6b980438b0adad990321e (patch) | |
tree | 70285041cdcd30fedc248d3eae351153210961e7 /drivers/tty | |
parent | tty: Remove redundant synclinkmp driver (diff) | |
download | linux-cbd90e746148339ddbf6b980438b0adad990321e.tar.xz linux-cbd90e746148339ddbf6b980438b0adad990321e.zip |
serial: mctrl_gpio: Fix passing zero to 'ERR_PTR' warning
drivers/tty/serial/serial_mctrl_gpio.c:214
mctrl_gpio_init() warn: passing zero to 'ERR_PTR'
gpiod_to_irq() never return 0, so remove the useless test
and make code more clear.
Reviewed-by: Jiri Slaby <jirislaby@kernel.org>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Link: https://lore.kernel.org/r/20201031030530.1304-1-yuehaibing@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r-- | drivers/tty/serial/serial_mctrl_gpio.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/tty/serial/serial_mctrl_gpio.c b/drivers/tty/serial/serial_mctrl_gpio.c index fb4781292d40..c41d8911ce95 100644 --- a/drivers/tty/serial/serial_mctrl_gpio.c +++ b/drivers/tty/serial/serial_mctrl_gpio.c @@ -207,7 +207,7 @@ struct mctrl_gpios *mctrl_gpio_init(struct uart_port *port, unsigned int idx) continue; ret = gpiod_to_irq(gpios->gpio[i]); - if (ret <= 0) { + if (ret < 0) { dev_err(port->dev, "failed to find corresponding irq for %s (idx=%d, err=%d)\n", mctrl_gpios_desc[i].name, idx, ret); |