Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

YueHaibing and committed by
Greg Kroah-Hartman
cbd90e74 3d608a59

+1 -1
+1 -1
drivers/tty/serial/serial_mctrl_gpio.c
··· 207 207 continue; 208 208 209 209 ret = gpiod_to_irq(gpios->gpio[i]); 210 - if (ret <= 0) { 210 + if (ret < 0) { 211 211 dev_err(port->dev, 212 212 "failed to find corresponding irq for %s (idx=%d, err=%d)\n", 213 213 mctrl_gpios_desc[i].name, idx, ret);