Re: [PATCH v5 2/3] tty/serial: at91: use mctrl_gpio helpers
Alexander Shiyan
shc_work at mail.ru
Mon Mar 3 06:22:43 EST 2014
Hello.
Понедельник, 3 марта 2014, 12:11 +01:00 от Richard Genoud <noreply.rgenoud at gmail.com>:
> On sam9x5, dedicated CTS (and RTS) pins are unusable together with the
> LCDC, the EMAC, or the MMC because they share the same line.
>
> Moreover, the USART controller doesn't handle DTR/DSR/DCD/RI signals,
> so we have to control them via GPIO.
>
> This patch permits to use GPIOs to control the CTS/RTS/DTR/DSR/DCD/RI
> signals.
>
> Signed-off-by: Richard Genoud <richard.genoud at gmail.com>
...
> +static int atmel_init_gpios(struct atmel_uart_port *p, struct device *dev)
> +{
> + int err = 0;
> +
> + p->gpios = mctrl_gpio_init(dev, 0);
> + if (IS_ERR_OR_NULL(p->gpios))
> + err = PTR_ERR(p->gpios);
> +
> + return err;
> +}
So what happen if mctrl_gpio_init() returns NULL?
Your function return 0, ie not an error.
Just use IS_ERR() macro here.
Thanks.
---
More information about the linux-arm-kernel
mailing list